diff --git a/client/dom/index.js b/client/dom/index.js index 2f5b2bc3..13442bde 100644 --- a/client/dom/index.js +++ b/client/dom/index.js @@ -1360,19 +1360,25 @@ function CmdProto() { }); }, - this.duplicatePanel = function() { - var isDir = CurrentInfo.isDir; - var path = CurrentInfo.dirPath; - var panel = CurrentInfo.panelPassive; - var noCurrent = !CurrentInfo.isOnePanel; + this.duplicatePanel = () => { + const Info = CurrentInfo; + const isDir = Info.isDir; + const panel = Info.panelPassive; + const noCurrent = !Info.isOnePanel; - if (isDir) - path = CurrentInfo.path; + const getPath = (isDir) => { + if (isDir) + return Info.path; + + return Info.dirPath; + }; + + const path = getPath(isDir); CloudCmd.loadDir({ - path: path, - panel: panel, - noCurrent: noCurrent, + path, + panel, + noCurrent, }); };