mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(dom) processFiles
This commit is contained in:
parent
5985fbae42
commit
4b4e3d42f3
1 changed files with 9 additions and 11 deletions
|
|
@ -1465,9 +1465,12 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
* @param operation
|
||||
*/
|
||||
function processFiles(operation) {
|
||||
var n, name, from, to, files, cmp, msg, opFunc,
|
||||
path = CurrentInfo.dirPath,
|
||||
var n, name, files, cmp, msg, opFunc,
|
||||
RESTful = DOM.RESTful,
|
||||
|
||||
from = CurrentInfo.dirPath,
|
||||
to = DOM.getNotCurrentDirPath(),
|
||||
|
||||
names = Cmd.getSelectedNames(),
|
||||
|
||||
length = names && names.length;
|
||||
|
|
@ -1487,18 +1490,13 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
name = names[0];
|
||||
}
|
||||
|
||||
n = names.length;
|
||||
|
||||
if (n > 1)
|
||||
if (length > 1)
|
||||
msg += n + ' file(s)';
|
||||
else
|
||||
msg += '"' + name + '"';
|
||||
|
||||
msg += ' to';
|
||||
|
||||
from = path;
|
||||
to = DOM.getNotCurrentDirPath();
|
||||
|
||||
if (name === '..') {
|
||||
Dialog.alert('No files selected!');
|
||||
} else {
|
||||
|
|
@ -1509,8 +1507,8 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
if (!cmp && to) {
|
||||
files = {
|
||||
from : from,
|
||||
names : names,
|
||||
to : to
|
||||
to : to,
|
||||
names : names
|
||||
};
|
||||
|
||||
opFunc(files, function() {
|
||||
|
|
@ -1524,7 +1522,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
|
||||
DOM.setCurrentFile(dotDot);
|
||||
CloudCmd.refresh(dotDot, panelPassive);
|
||||
DOM.Storage.remove(path);
|
||||
DOM.Storage.remove(from);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue