Create a new pad from the file manager

This commit is contained in:
yflory
2016-11-21 18:49:13 +01:00
parent 4fcdece4af
commit a957b72598
5 changed files with 23 additions and 8 deletions

View File

@@ -547,10 +547,19 @@ define([
pushToTrash(key, href, [UNSORTED]);
};
var addUnsortedPad = exp.addPad = function (href) {
var addUnsortedPad = exp.addPad = function (href, path, name) {
var unsortedFiles = getUnsortedFiles().slice();
var rootFiles = getRootFiles().slice();
var trashFiles = getTrashFiles().slice();
if (path && name) {
var newPath = decodeURIComponent(path).split(',');
var parentEl = findElement(files, newPath);
if (parentEl) {
var newName = getAvailableName(parentEl, name);
parentEl[newName] = href;
return;
}
}
if (unsortedFiles.indexOf(href) === -1 && rootFiles.indexOf(href) === -1 && trashFiles.indexOf(href) === -1) {
files[UNSORTED].push(href);
}