Display the 'New' button in the trash

pull/1/head
yflory 8 years ago
parent 00efc96919
commit 3f44444f41

@ -577,7 +577,7 @@ define([
if (!contains) {
var data = makePad(href, name);
renamed.push(data);
if (USE_FS_STORE && common.initialPath && typeof(getStore().addPad) === "function") {
if (USE_FS_STORE && typeof(getStore().addPad) === "function") {
getStore().addPad(href, common.initialPath, name);
}
}

@ -866,7 +866,7 @@ define([
options.push({tag: 'hr'});
}
AppConfig.availablePadTypes.forEach(function (type) {
var path = '/#?path=' + encodeURIComponent(currentPath);
var path = filesOp.isPathInTrash(currentPath) ? '' : '/#?path=' + encodeURIComponent(currentPath);
options.push({
tag: 'a',
attributes: {
@ -1253,9 +1253,7 @@ define([
var $modeButton = createViewModeButton().appendTo($toolbar.find('.rightside'));
var $title = createTitle(path).appendTo($toolbar.find('.rightside'));
if (!filesOp.isPathInTrash(path)) {
createNewButton(isInRoot).appendTo($toolbar.find('.leftside'));
}
createNewButton(isInRoot).appendTo($toolbar.find('.leftside'));
var $folderHeader = getFolderListHeader();
var $fileHeader = getFileListHeader(true);
@ -1312,14 +1310,14 @@ define([
if (collapsable) {
$collapse = $expandIcon.clone();
}
var $element = $('<li>').append($collapse).append($icon).append($name)
.click(function () {
module.displayDirectory(path);
});
var $element = $('<li>').append($collapse).append($icon).append($name).click(function (e) {
module.displayDirectory(path);
});
if (draggable) { $element.attr('draggable', true); }
if (collapsable) {
$element.addClass('collapsed');
$collapse.click(function() {
$collapse.click(function(e) {
e.stopPropagation();
if ($element.hasClass('collapsed')) {
// It is closed, open it
$element.removeClass('collapsed');
@ -1697,10 +1695,11 @@ define([
return false;
}).on('remove', [], function (o, p) {
var path = arguments[1];
if ((filesOp.isPathInUnsorted(currentPath) && filesOp.isPathInUnsorted(path)) ||
(filesOp.isPathInTemplate(currentPath) && filesOp.isPathInTemplate(path)) ||
(path.length >= currentPath.length && filesOp.isSubpath(path, currentPath)) ||
(filesOp.isPathInTrash(currentPath) && filesOp.isPathInTrash(path))) {
var cPath = currentPath.slice();
if ((filesOp.isPathInUnsorted(cPath) && filesOp.isPathInUnsorted(path)) ||
(filesOp.isPathInTemplate(cPath) && filesOp.isPathInTemplate(path)) ||
(path.length >= cPath.length && filesOp.isSubpath(path, cPath)) ||
(filesOp.isPathInTrash(cPath) && filesOp.isPathInTrash(path))) {
// Reload after a few to make sure all the change events have been received
onRefresh.to = window.setTimeout(refresh, 500);
}

Loading…
Cancel
Save