mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(key) switchKey: SPACE
This commit is contained in:
parent
ead6ffc074
commit
0eb4ef06ac
1 changed files with 10 additions and 12 deletions
|
|
@ -160,7 +160,7 @@ var CloudCmd, Util, DOM;
|
|||
}
|
||||
|
||||
function switchKey(event) {
|
||||
var i, id, obj, files,
|
||||
var i, id, obj, files, name, isSelected, isDir,
|
||||
current = Info.element,
|
||||
panel = Info.panel,
|
||||
path = Info.path,
|
||||
|
|
@ -190,7 +190,7 @@ var CloudCmd, Util, DOM;
|
|||
|
||||
DOM.setCurrentFile(current);
|
||||
|
||||
DOM.preventDefault(event);//запрет на дальнейшее действие
|
||||
DOM.preventDefault(event);
|
||||
break;
|
||||
|
||||
case Key.INSERT:
|
||||
|
|
@ -290,22 +290,20 @@ var CloudCmd, Util, DOM;
|
|||
break;
|
||||
|
||||
case Key.SPACE:
|
||||
var lSelected,
|
||||
isDir = Info.isDir,
|
||||
lName = Info.name;
|
||||
isDir = Info.isDir,
|
||||
name = Info.name;
|
||||
|
||||
if (!isDir || lName === '..')
|
||||
lSelected = true;
|
||||
if (!isDir || name === '..')
|
||||
isSelected = true;
|
||||
else
|
||||
lSelected = Info.isSelected;
|
||||
isSelected = Info.isSelected;
|
||||
|
||||
Util.ifExec(lSelected, function() {
|
||||
Util.ifExec(isSelected, function() {
|
||||
DOM.toggleSelectedFile(current);
|
||||
}, function(pCallBack) {
|
||||
DOM.loadCurrentSize(pCallBack, current);
|
||||
}, function(callback) {
|
||||
DOM.loadCurrentSize(callback, current);
|
||||
});
|
||||
|
||||
|
||||
DOM.preventDefault(event);
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue