From 6706d359f488d08e4a77f223127eb5bff3781820 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 14 Jun 2017 11:24:52 +0300 Subject: [PATCH] fix(client) baseInit: init both panels in OnePanelMode (#116) --- client/client.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/client/client.js b/client/client.js index 6ce8b97a..5afab0cd 100644 --- a/client/client.js +++ b/client/client.js @@ -323,8 +323,8 @@ function CloudCmdProto(Util, DOM) { Listeners = CloudCmd.Listeners; Listeners.init(); - Listeners.setOnPanel('left'); - Listeners.setOnPanel('right'); + const panels = getPanels(); + panels.forEach(Listeners.setOnPanel); Listeners.initKeysPanel(); @@ -338,6 +338,18 @@ function CloudCmdProto(Util, DOM) { callback(); } + function getPanels() { + const panels = ['left']; + + if (CloudCmd.config('onePanelMode')) + return panels; + + return [ + ...panels, + 'rigth', + ]; + } + this.execFromModule = (moduleName, funcName, ...args) => { const obj = CloudCmd[moduleName]; const isObj = itype.object(obj);