diff --git a/lib/client/dom.js b/lib/client/dom.js index 4d7bef0b..c321cff3 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -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; };