From fd63e86a2245c29650a4c15e96e3c5aceb095f84 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 27 Feb 2018 09:00:29 +0100 Subject: [PATCH] don't re execute render 2 times + fix plugin --- src/app/panels/righthand-panel.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js index 17c80b9a61..189873df80 100644 --- a/src/app/panels/righthand-panel.js +++ b/src/app/panels/righthand-panel.js @@ -55,17 +55,19 @@ function RighthandPanel (appAPI = {}, events = {}, opts = {}) { optionViews.appendChild(debuggerTab.render()) var supportTab = new SupportTab(appAPI, events) optionViews.appendChild(supportTab.render()) - this._view.tabbedMenu.addTab('Compile', 'compileView', compileTab.render()) - this._view.tabbedMenu.addTab('Run', 'runView', runTab.render()) - this._view.tabbedMenu.addTab('Settings', 'settingsView', settingsTab.render()) - this._view.tabbedMenu.addTab('Analysis', 'staticanalysisView', analysisTab.render()) - this._view.tabbedMenu.addTab('Debugger', 'debugView', debuggerTab.render()) - this._view.tabbedMenu.addTab('Support', 'supportView', supportTab.render()) + this._view.tabbedMenu.addTab('Compile', 'compileView', optionViews.querySelector('#compileTabView')) + this._view.tabbedMenu.addTab('Run', 'runView', optionViews.querySelector('#runTabView')) + this._view.tabbedMenu.addTab('Settings', 'settingsView', optionViews.querySelector('#settingsView')) + this._view.tabbedMenu.addTab('Analysis', 'staticanalysisView', optionViews.querySelector('#staticanalysisView')) + this._view.tabbedMenu.addTab('Debugger', 'debugView', optionViews.querySelector('#debugView')) + this._view.tabbedMenu.addTab('Support', 'supportView', optionViews.querySelector('#supportView')) this._view.tabbedMenu.selectTabByTitle('Compile') self.pluginManager = new PluginManager(appAPI, events) events.rhp.register('plugin-loadRequest', (json) => { - var content = new PluginTab(appAPI, events, json) + var tab = new PluginTab(appAPI, events, json) + var content = tab.render() + optionViews.appendChild(content) this._view.tabbedMenu.addTab(json.title, 'plugin', content) self.pluginManager.register(json, content) })