diff --git a/lib/client/key.js b/lib/client/key.js index fd2368b5..39d50a0f 100644 --- a/lib/client/key.js +++ b/lib/client/key.js @@ -162,7 +162,7 @@ var CloudCmd, Util, DOM; } function switchKey(pEvent) { - var i, n, id, obj, + var i, n, id, obj, files, current = Info.element, panel = Info.panel, path = Info.path, @@ -178,15 +178,19 @@ var CloudCmd, Util, DOM; switch (lKeyCode) { case Key.TAB: id = panel.id; - TabPanel[id] = current; + TabPanel[id] = current; panel = Info.panelPassive; id = panel.id; - current = TabPanel[id]; + current = TabPanel[id]; - if (current && current.parentElement) - DOM.setCurrentFile(current); + if (current) { + files = current.parentElement; + + if (files && files.parentElement) + DOM.setCurrentFile(current); + } else { current = filesPassive[0]; DOM.setCurrentFile(current);