mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(deleteSelected) rm param notSet
This commit is contained in:
parent
7efe125916
commit
94a153a0a0
1 changed files with 7 additions and 12 deletions
|
|
@ -1554,10 +1554,9 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
/**
|
||||
* remove current file from file table
|
||||
* @param current
|
||||
* @param notSet
|
||||
*
|
||||
*/
|
||||
this.deleteCurrent = function(current, notSet) {
|
||||
this.deleteCurrent = function(current) {
|
||||
var name, next, prev, parent;
|
||||
|
||||
if (!current)
|
||||
|
|
@ -1570,11 +1569,10 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
next = current.nextSibling,
|
||||
prev = current.previousSibling;
|
||||
|
||||
if (!notSet)
|
||||
if (next)
|
||||
this.setCurrentFile(next);
|
||||
else if (prev)
|
||||
this.setCurrentFile(prev);
|
||||
if (next)
|
||||
this.setCurrentFile(next);
|
||||
else if (prev)
|
||||
this.setCurrentFile(prev);
|
||||
|
||||
parent.removeChild(current);
|
||||
}
|
||||
|
|
@ -1587,7 +1585,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
* @Selected
|
||||
*/
|
||||
this.deleteSelected = function(selected) {
|
||||
var i, n, last, next, prev, current;
|
||||
var i, n, last, current;
|
||||
|
||||
if (!selected)
|
||||
selected = this.getSelectedFiles();
|
||||
|
|
@ -1597,10 +1595,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
|
||||
for (i = 0; i < n; i++) {
|
||||
current = selected[i];
|
||||
next = current.nextSibling,
|
||||
prev = current.previousSibling;
|
||||
|
||||
this.deleteCurrent(current, i !== n-1);
|
||||
this.deleteCurrent(current);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue