mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(menu) add "(Un)Select All"
This commit is contained in:
parent
f41b3f021d
commit
143bcd65b6
4 changed files with 18 additions and 8 deletions
|
|
@ -100,6 +100,7 @@ Right mouse click button shows context menu with items:
|
|||
- Rename
|
||||
- Delete
|
||||
- Zip file
|
||||
- (Un)Select All
|
||||
- Upload to (Dropbox, Github, GDrive)
|
||||
- Download
|
||||
- New (File, Dir, from cloud)
|
||||
|
|
|
|||
|
|
@ -1478,6 +1478,20 @@ var CloudCmd, Util, DOM, CloudFunc;
|
|||
return this;
|
||||
};
|
||||
|
||||
this.toggleAllSelectedFiles = function(pCurrent) {
|
||||
var i, n,
|
||||
isStr = Util.isString(pCurrent),
|
||||
lCurrent = !isStr && pCurrent || Cmd.getCurrentFile(),
|
||||
lParent = lCurrent.parentElement,
|
||||
lNodes = lParent.childNodes;
|
||||
|
||||
/* not path and fm_header */
|
||||
for (i = 2, n = lNodes.length; i < n; i++)
|
||||
DOM.toggleSelectedFile( lNodes[i] );
|
||||
|
||||
return Cmd;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* setting history wrapper
|
||||
|
|
|
|||
|
|
@ -269,14 +269,8 @@ var CloudCmd, Util, DOM;
|
|||
|
||||
case Key.A:
|
||||
if (pEvent.ctrlKey) {
|
||||
var lParent = lCurrent.parentElement,
|
||||
lNodes = lParent.childNodes;
|
||||
|
||||
/* not path and fm_header */
|
||||
for (i = 2, n = lNodes.length; i < n; i++)
|
||||
DOM.toggleSelectedFile( lNodes[i] );
|
||||
|
||||
DOM.preventDefault(pEvent);
|
||||
DOM .toggleAllSelectedFiles(lCurrent)
|
||||
.preventDefault(pEvent);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
setTimeout( Util.retExec(DOM.renameCurrent), 100);
|
||||
},
|
||||
'Delete' : Util.retExec(DOM.promptDeleteSelected),
|
||||
'(Un)Select All': DOM.toggleAllSelectedFiles,
|
||||
'Zip file' : DOM.zipFile
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue