From 070d89bad0c5eee8bbc9ce6864179c9ff338ea95 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 21 Jan 2014 03:28:58 -0500 Subject: [PATCH] refactor(key) switchKey --- lib/client/key.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/client/key.js b/lib/client/key.js index 965f9e45..85e0b73e 100644 --- a/lib/client/key.js +++ b/lib/client/key.js @@ -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() {