mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
fix(dom) selectByPattern: last selected file
This commit is contained in:
parent
e4cf58b433
commit
a104de3509
1 changed files with 4 additions and 5 deletions
|
|
@ -943,7 +943,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
};
|
||||
|
||||
function selectByPattern(msg, files) {
|
||||
var n,
|
||||
var n, regExp,
|
||||
allMsg = 'Specify file type for ' + msg + ' selection',
|
||||
i = 0,
|
||||
type,
|
||||
|
|
@ -958,7 +958,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
if (type !== null) {
|
||||
SelectType = type;
|
||||
|
||||
type = Util.getRegExp(type);
|
||||
regExp = Util.getRegExp(type);
|
||||
|
||||
n = files && files.length;
|
||||
for (i = 0; i < n; i++) {
|
||||
|
|
@ -966,7 +966,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
name = DOM.getCurrentName(current);
|
||||
|
||||
if (name !== '..') {
|
||||
isMatch = name.match(new RegExp(type));
|
||||
isMatch = regExp.test(name);
|
||||
|
||||
if (isMatch) {
|
||||
++matches;
|
||||
|
|
@ -978,8 +978,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
|
||||
if (isSelected)
|
||||
DOM.toggleSelectedFile(current);
|
||||
} else if (!shouldSel)
|
||||
++i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue