mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(dom) getSelectedNames: for -> map
This commit is contained in:
parent
a14081faa6
commit
cce748c4e3
1 changed files with 4 additions and 6 deletions
|
|
@ -1126,7 +1126,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
};
|
||||
|
||||
this.getSelectedNames = function(selected) {
|
||||
var current, first, name, i, n, isSelected,
|
||||
var first, name, isSelected,
|
||||
ret = [];
|
||||
|
||||
if (!selected)
|
||||
|
|
@ -1148,11 +1148,9 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
this.toggleSelectedFile(first);
|
||||
}
|
||||
|
||||
n = selected.length;
|
||||
for (i = 0; i < n;i++) {
|
||||
current = selected[i];
|
||||
ret[i] = this.getCurrentName(current);
|
||||
}
|
||||
ret = selected.map(function(current) {
|
||||
return Cmd.getCurrentName(current);
|
||||
});
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue