diff --git a/lib/client/dom.js b/lib/client/dom.js index 592cbedb..987c78dd 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1528,9 +1528,10 @@ var CloudCmd, Util, DOM, CloudFunc; }, this.duplicatePanel = function() { - var isDir = CurrentInfo.isDir, - path = CurrentInfo.dirPath, - panel = CurrentInfo.panelPassive; + var isDir = CurrentInfo.isDir; + var path = CurrentInfo.dirPath; + var panel = CurrentInfo.panelPassive; + var noCurrent = !CurrentInfo.isOnePanel; if (isDir) path = CurrentInfo.path; @@ -1538,7 +1539,7 @@ var CloudCmd, Util, DOM, CloudFunc; CloudCmd.loadDir({ path: path, panel: panel, - noCurrent: true + noCurrent: noCurrent, }); }; diff --git a/lib/client/key.js b/lib/client/key.js index d868ad95..e51c4bbe 100644 --- a/lib/client/key.js +++ b/lib/client/key.js @@ -391,25 +391,29 @@ var CloudCmd, Util, DOM; break; case Key.LEFT: - if (alt) { - name = Info.panel.getAttribute('data-name'); - - if (name === 'js-right') { - DOM.duplicatePanel(); - event.preventDefault(); - } - } + if (!alt) + return; + + event.preventDefault(); + + name = Info.panel.getAttribute('data-name'); + + if (name === 'js-right') + DOM.duplicatePanel(); + break; case Key.RIGHT: - if (alt) { - name = Info.panel.getAttribute('data-name'); - - if (name === 'js-left') { - DOM.duplicatePanel(); - event.preventDefault(); - } - } + if (!alt) + return; + + event.preventDefault(); + + name = Info.panel.getAttribute('data-name'); + + if (name === 'js-left') + DOM.duplicatePanel(); + break; /* in case of pressing button 'Home', *