mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
feature(dom) add swapPanels
This commit is contained in:
parent
63a5ad275b
commit
fe422743bb
3 changed files with 40 additions and 0 deletions
1
HELP.md
1
HELP.md
|
|
@ -122,6 +122,7 @@ Hot keys
|
|||
| `Ctrl + r` | refresh
|
||||
| `Ctrl + d` | clear local storage
|
||||
| `Ctrl + a` | select all files in a panel
|
||||
| `Ctrl + u` | swap panels
|
||||
| `Up`, `Down`, `Enter` | file system navigation
|
||||
| `Alt + Left/Right` | show content of directory under cursor in target panel
|
||||
| `Ctrl + \` | go to the root directory
|
||||
|
|
|
|||
|
|
@ -1788,6 +1788,39 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
});
|
||||
};
|
||||
|
||||
this.swapPanels = function() {
|
||||
var Info = CurrentInfo,
|
||||
panel = Info.panel,
|
||||
panelPassive = Info.panelPassive,
|
||||
|
||||
currentIndex = [].indexOf.call(Info.files, Info.element),
|
||||
|
||||
dirPath = DOM.getCurrentDirPath(),
|
||||
dirPathPassive = DOM.getNotCurrentDirPath();
|
||||
|
||||
CloudCmd.loadDir({
|
||||
path: dirPath,
|
||||
panel: panelPassive,
|
||||
noCurrent: true
|
||||
});
|
||||
|
||||
CloudCmd.loadDir({
|
||||
path: dirPathPassive,
|
||||
panel: panel
|
||||
}, function() {
|
||||
var el,
|
||||
files = Info.files,
|
||||
length = files.length - 1;
|
||||
|
||||
if (currentIndex > length)
|
||||
currentIndex = length;
|
||||
|
||||
el = files[currentIndex];
|
||||
|
||||
DOM.setCurrentFile(el);
|
||||
});
|
||||
};
|
||||
|
||||
this.CurrentInfo = CurrentInfo,
|
||||
|
||||
this.updateCurrentInfo = function(currentFile) {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ var CloudCmd, Util, DOM;
|
|||
R : 82,
|
||||
S : 83,
|
||||
T : 84,
|
||||
U : 85,
|
||||
|
||||
V : 86,
|
||||
|
||||
|
|
@ -352,6 +353,11 @@ var CloudCmd, Util, DOM;
|
|||
event.preventDefault();
|
||||
break;
|
||||
|
||||
case Key.U:
|
||||
if (ctrlMeta)
|
||||
DOM.swapPanels();
|
||||
break;
|
||||
|
||||
/* навигация по таблице файлов *
|
||||
* если нажали клавишу вверх *
|
||||
* выделяем предыдущую строку */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue