From 0f70b5da31c24c4ede96cda9af50737222bbef20 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 27 Feb 2017 15:09:40 +0200 Subject: [PATCH] chore(dom) duplicatePanel: es2015-ify --- client/dom/index.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) 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, }); };