mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
feature(dom) duplicatePanel: show content of directory under cursor in target panel
This commit is contained in:
parent
8e94045cc0
commit
63a5ad275b
3 changed files with 44 additions and 2 deletions
1
HELP.md
1
HELP.md
|
|
@ -123,6 +123,7 @@ Hot keys
|
|||
| `Ctrl + d` | clear local storage
|
||||
| `Ctrl + a` | select all files in a panel
|
||||
| `Up`, `Down`, `Enter` | file system navigation
|
||||
| `Alt + Left/Right` | show content of directory under cursor in target panel
|
||||
| `Ctrl + \` | go to the root directory
|
||||
| `Tab` | move via panels
|
||||
| `Page Up` | up on one page
|
||||
|
|
|
|||
|
|
@ -1773,6 +1773,21 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
return this;
|
||||
};
|
||||
|
||||
this.duplicatePanel = function() {
|
||||
var isDir = CurrentInfo.isDir,
|
||||
path = CurrentInfo.dirPath,
|
||||
panel = CurrentInfo.panelPassive;
|
||||
|
||||
if (isDir)
|
||||
path = CurrentInfo.path;
|
||||
|
||||
CloudCmd.loadDir({
|
||||
path: path,
|
||||
panel: panel,
|
||||
noCurrent: true
|
||||
});
|
||||
};
|
||||
|
||||
this.CurrentInfo = CurrentInfo,
|
||||
|
||||
this.updateCurrentInfo = function(currentFile) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,10 @@ var CloudCmd, Util, DOM;
|
|||
PAGE_DOWN : 34,
|
||||
END : 35,
|
||||
HOME : 36,
|
||||
|
||||
LEFT : 37,
|
||||
UP : 38,
|
||||
RIGHT : 39,
|
||||
DOWN : 40,
|
||||
|
||||
INSERT : 45,
|
||||
|
|
@ -217,6 +220,7 @@ var CloudCmd, Util, DOM;
|
|||
panel = Info.panel,
|
||||
path = Info.path,
|
||||
keyCode = event.keyCode,
|
||||
alt = event.altKey,
|
||||
shift = event.shiftKey,
|
||||
ctrl = event.ctrlKey,
|
||||
meta = event.metaKey,
|
||||
|
|
@ -353,7 +357,7 @@ var CloudCmd, Util, DOM;
|
|||
* выделяем предыдущую строку */
|
||||
case Key.UP:
|
||||
if (shift)
|
||||
DOM.toggleSelectedFile(current);
|
||||
DOM.toggleSelectedFile(current);
|
||||
|
||||
DOM.setCurrentFile(prev);
|
||||
event.preventDefault();
|
||||
|
|
@ -362,12 +366,34 @@ var CloudCmd, Util, DOM;
|
|||
/* если нажали клавишу в низ - выделяем следующую строку */
|
||||
case Key.DOWN:
|
||||
if (shift)
|
||||
DOM.toggleSelectedFile(current);
|
||||
DOM.toggleSelectedFile(current);
|
||||
|
||||
DOM.setCurrentFile(next);
|
||||
event.preventDefault();
|
||||
break;
|
||||
|
||||
case Key.LEFT:
|
||||
if (alt) {
|
||||
name = Info.panel.getAttribute('data-name');
|
||||
|
||||
if (name === 'js-right') {
|
||||
DOM.duplicatePanel();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case Key.RIGHT:
|
||||
if (alt) {
|
||||
name = Info.panel.getAttribute('data-name');
|
||||
|
||||
if (name === 'js-left') {
|
||||
DOM.duplicatePanel();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/* если нажали клавишу Home *
|
||||
* переходим к самому верхнему *
|
||||
* элементу */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue