mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
refactor(key) switchKey
This commit is contained in:
parent
0402bbb127
commit
070d89bad0
1 changed files with 10 additions and 10 deletions
|
|
@ -160,6 +160,7 @@ var CloudCmd, Util, DOM;
|
|||
function switchKey(pEvent) {
|
||||
var i, n,
|
||||
lCurrent = Info.element,
|
||||
panel = Info.panel,
|
||||
prev = lCurrent.previousSibling,
|
||||
next = lCurrent.nextSibling,
|
||||
lKeyCode = pEvent.keyCode,
|
||||
|
|
@ -169,21 +170,20 @@ var CloudCmd, Util, DOM;
|
|||
|
||||
switch (lKeyCode) {
|
||||
case Key.TAB:
|
||||
var lFirstFileOnList,
|
||||
lPanel = Info.panel,
|
||||
lId = lPanel.id;
|
||||
var lFirstFileOnList, id;
|
||||
|
||||
lTabPanel[lId] = lCurrent;
|
||||
id = panel.id;
|
||||
lTabPanel[id] = lCurrent;
|
||||
|
||||
lPanel = Info.panelPassive;
|
||||
lId = lPanel.id;
|
||||
panel = Info.panelPassive;
|
||||
id = panel.id;
|
||||
|
||||
lCurrent = lTabPanel[lId];
|
||||
lCurrent = lTabPanel[id];
|
||||
|
||||
if (lCurrent && lCurrent.parentElement)
|
||||
DOM.setCurrentFile(lCurrent);
|
||||
else {
|
||||
lFirstFileOnList = DOM.getByTag('li', lPanel)[2];
|
||||
lFirstFileOnList = DOM.getByTag('li', panel)[2];
|
||||
|
||||
DOM.setCurrentFile(lFirstFileOnList);
|
||||
}
|
||||
|
|
@ -335,7 +335,7 @@ var CloudCmd, Util, DOM;
|
|||
|
||||
/* если нажали клавишу page down проматываем экран */
|
||||
case Key.PAGE_DOWN:
|
||||
DOM.scrollByPages( DOM.getPanel(), 1 );
|
||||
DOM.scrollByPages(panel, 1);
|
||||
|
||||
for (i = 0; i < 30; i++) {
|
||||
|
||||
|
|
@ -350,7 +350,7 @@ var CloudCmd, Util, DOM;
|
|||
|
||||
/* если нажали клавишу page up проматываем экран */
|
||||
case Key.PAGE_UP:
|
||||
DOM.scrollByPages(DOM.getPanel(), -1);
|
||||
DOM.scrollByPages(panel, -1);
|
||||
|
||||
var tryCatch = function(pCurrentFile) {
|
||||
Util.tryCatch(function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue