From 66e056a873fae1aea1fd432deac58765c93e9a28 Mon Sep 17 00:00:00 2001 From: serapath Date: Thu, 7 Jun 2018 20:50:34 -0400 Subject: [PATCH] rhp: refactor to self._components --- src/app/panels/righthand-panel.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js index fbd168ed1d..bb15d66a6f 100644 --- a/src/app/panels/righthand-panel.js +++ b/src/app/panels/righthand-panel.js @@ -34,7 +34,17 @@ module.exports = class RighthandPanel { tabbedMenuViewport: null, dragbar: null } - self._components = {} + self._components = { + pluginManager: new PluginManager(self._opts.pluginAPI, self._events), + tabbedMenu: new TabbedMenu(self._api, self._events), + compile: new CompileTab(self._api, self._events, self._opts), + run: new RunTab(self._api, self._events, self._opts), + settings: new SettingsTab(self._api, self._events, self._opts), + analysis: new AnalysisTab(self._api, self._events, self._opts), + debug: new DebuggerTab(self._api, self._events, self._opts), + support: new SupportTab(self._api, self._events, self._opts), + test: new TestTab(self._api, self._events, self._opts) + } self.event.register('plugin-loadRequest', json => { const tab = new PluginTab({}, self._events, json) @@ -46,14 +56,6 @@ module.exports = class RighthandPanel { self._components.pluginManager = new PluginManager(self._opts.pluginAPI, self._events) self._components.tabbedMenu = new TabbedMenu(self._api, self._events) - const compile = new CompileTab(self._api, self._events, self._opts) - const run = new RunTab(self._api, self._events, self._opts) - const settings = new SettingsTab(self._api, self._events, self._opts) - const analysis = new AnalysisTab(self._api, self._events, self._opts) - const debug = new DebuggerTab(self._api, self._events, self._opts) - const support = new SupportTab(self._api, self._events, self._opts) - const test = new TestTab(self._api, self._events, self._opts) - self._view.dragbar = yo`
` self._view.element = yo`
@@ -64,7 +66,7 @@ module.exports = class RighthandPanel {
` - // const { compile, run, settings, analysis, debug, support } = self._components + const { compile, run, settings, analysis, debug, support, test } = self._components self._components.tabbedMenu.addTab('Compile', 'compileView', compile.render()) self._components.tabbedMenu.addTab('Run', 'runView', run.render()) self._components.tabbedMenu.addTab('Settings', 'settingsView', settings.render())