mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 09:24:51 +00:00
refactor(dom) promptDeletSelected: rm current || names
This commit is contained in:
parent
6aacedb656
commit
475633ecc6
1 changed files with 13 additions and 16 deletions
|
|
@ -791,8 +791,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
if (isDir) {
|
||||
query = '?dir';
|
||||
type ='directory';
|
||||
}
|
||||
else
|
||||
} else
|
||||
type = 'file';
|
||||
|
||||
type += ' ';
|
||||
|
|
@ -806,20 +805,18 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
else
|
||||
Dialog.alert('No files selected!');
|
||||
|
||||
if (ret) {
|
||||
if (current || names)
|
||||
RESTful.delete(path, names, function() {
|
||||
var dirPath = CurrentInfo.dirPath,
|
||||
dir = CloudFunc.rmLastSlash(dirPath);
|
||||
|
||||
if (n > 1)
|
||||
DOM.deleteSelected(files);
|
||||
else
|
||||
DOM.deleteCurrent(current);
|
||||
|
||||
Storage.remove(dir);
|
||||
}, query);
|
||||
}
|
||||
if (ret)
|
||||
RESTful.delete(path, names, function() {
|
||||
var dirPath = CurrentInfo.dirPath,
|
||||
dir = CloudFunc.rmLastSlash(dirPath);
|
||||
|
||||
if (n > 1)
|
||||
DOM.deleteSelected(files);
|
||||
else
|
||||
DOM.deleteCurrent(current);
|
||||
|
||||
Storage.remove(dir);
|
||||
}, query);
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue