|
|
@ -234,9 +234,9 @@ define([
|
|
|
|
return LS;
|
|
|
|
return LS;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var getViewModeClass = function () {
|
|
|
|
var getViewModeClass = function (forceList) {
|
|
|
|
var mode = APP.store[LS_VIEWMODE];
|
|
|
|
var mode = APP.store[LS_VIEWMODE];
|
|
|
|
if (mode === 'list') { return 'cp-app-drive-content-list'; }
|
|
|
|
if (mode === 'list' || forceList) { return 'cp-app-drive-content-list'; }
|
|
|
|
return 'cp-app-drive-content-grid';
|
|
|
|
return 'cp-app-drive-content-grid';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var getViewMode = function () {
|
|
|
|
var getViewMode = function () {
|
|
|
@ -3230,6 +3230,7 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
var $input = APP.Search.$input = $('<input>', {
|
|
|
|
var $input = APP.Search.$input = $('<input>', {
|
|
|
|
id: 'cp-app-drive-search-input',
|
|
|
|
id: 'cp-app-drive-search-input',
|
|
|
|
|
|
|
|
placeholder: Messages.fm_searchName,
|
|
|
|
type: 'text',
|
|
|
|
type: 'text',
|
|
|
|
draggable: false,
|
|
|
|
draggable: false,
|
|
|
|
tabindex: 1,
|
|
|
|
tabindex: 1,
|
|
|
@ -3288,8 +3289,24 @@ define([
|
|
|
|
$input.focus();
|
|
|
|
$input.focus();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$list.closest('#cp-app-drive-content-folder').addClass('cp-app-drive-content-list');
|
|
|
|
var $spinnerContainer = $(h('div.cp-app-drive-search-spinner')).appendTo($list);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var spinner = UI.makeSpinner($spinnerContainer);
|
|
|
|
|
|
|
|
if (typeof(value) == "string" && value.trim()) {
|
|
|
|
|
|
|
|
spinner.spin();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
|
|
//$list.closest('#cp-app-drive-content-folder').addClass('cp-app-drive-content-list');
|
|
|
|
var filesList = manager.search(value);
|
|
|
|
var filesList = manager.search(value);
|
|
|
|
|
|
|
|
if (!filesList.length) {
|
|
|
|
|
|
|
|
Messages.fm_noResult = "No result found"; // XXX
|
|
|
|
|
|
|
|
$list.append(h('div.cp-app-drive-search-noresult', Messages.fm_noResult));
|
|
|
|
|
|
|
|
spinner.hide();
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
var sortable = {};
|
|
|
|
var sortable = {};
|
|
|
|
var sortableFolders = [];
|
|
|
|
var sortableFolders = [];
|
|
|
|
filesList.forEach(function (r) {
|
|
|
|
filesList.forEach(function (r) {
|
|
|
@ -3351,6 +3368,8 @@ define([
|
|
|
|
addEl(obj, false);
|
|
|
|
addEl(obj, false);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
setTimeout(collapseDrivePath);
|
|
|
|
setTimeout(collapseDrivePath);
|
|
|
|
|
|
|
|
spinner.hide();
|
|
|
|
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var displayRecent = function ($list) {
|
|
|
|
var displayRecent = function ($list) {
|
|
|
@ -3606,13 +3625,12 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
var $dirContent = $('<div>', {id: FOLDER_CONTENT_ID});
|
|
|
|
var $dirContent = $('<div>', {id: FOLDER_CONTENT_ID});
|
|
|
|
$dirContent.data('path', path);
|
|
|
|
$dirContent.data('path', path);
|
|
|
|
if (!isSearch && !isTags) {
|
|
|
|
if (!isTags) {
|
|
|
|
var mode = getViewMode();
|
|
|
|
$dirContent.addClass(getViewModeClass(isSearch));
|
|
|
|
if (mode) {
|
|
|
|
if (!isSearch) {
|
|
|
|
$dirContent.addClass(getViewModeClass());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
createViewModeButton(APP.toolbar.$bottomR);
|
|
|
|
createViewModeButton(APP.toolbar.$bottomR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var $list = $('<ul>').appendTo($dirContent);
|
|
|
|
var $list = $('<ul>').appendTo($dirContent);
|
|
|
|
|
|
|
|
|
|
|
|