From 10cbb166452eb93eff82e411b73fd88dbd5472d9 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 14 May 2015 06:21:49 -0400 Subject: [PATCH] feature(dom) add goToDirectory --- HELP.md | 1 + lib/client/dom.js | 11 +++++++++++ lib/client/key.js | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/HELP.md b/HELP.md index 55028b18..543597f4 100644 --- a/HELP.md +++ b/HELP.md @@ -125,6 +125,7 @@ Hot keys | `Ctrl + u` | swap panels | `Up`, `Down`, `Enter` | file system navigation | `Alt + Left/Right` | show content of directory under cursor in target panel +| `Alt + g` | go to directory | `Ctrl + \` | go to the root directory | `Tab` | move via panels | `Page Up` | up on one page diff --git a/lib/client/dom.js b/lib/client/dom.js index c91504a6..f8781d58 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1772,6 +1772,17 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; return this; }; + this.goToDirectory = function() { + var msg = 'Go to directory:', + path = CurrentInfo.dirPath; + + path = prompt(msg, path); + + path && CloudCmd.loadDir({ + path: path + }); + }, + this.duplicatePanel = function() { var isDir = CurrentInfo.isDir, path = CurrentInfo.dirPath, diff --git a/lib/client/key.js b/lib/client/key.js index 80cecc5e..9baea6f4 100644 --- a/lib/client/key.js +++ b/lib/client/key.js @@ -472,6 +472,12 @@ var CloudCmd, Util, DOM; break; + case Key.G: + if (alt) + DOM.goToDirectory(); + + break; + /** * обновляем страницу, * загружаем содержимое каталога