From c66c29e3aaebcb646aed260ee5b56f4826c2bf94 Mon Sep 17 00:00:00 2001 From: serapath Date: Thu, 7 Jun 2018 05:57:05 -0400 Subject: [PATCH] rhp: refactor rhp/tabbedMenu relation --- src/app/panels/righthand-panel.js | 39 +++++++++---------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js index 7bd1edae68..684233ae66 100644 --- a/src/app/panels/righthand-panel.js +++ b/src/app/panels/righthand-panel.js @@ -38,9 +38,7 @@ module.exports = class RighthandPanel {
${self._view.dragbar}
@@ -51,34 +49,27 @@ module.exports = class RighthandPanel { self._events.rhp = self.event const compileTab = new CompileTab(self._api, self._events, self._opts) - optionViews.appendChild(compileTab.render()) const runTab = new RunTab(self._api, self._events, self._opts) - optionViews.appendChild(runTab.render()) const settingsTab = new SettingsTab(self._api, self._events, self._opts) - optionViews.appendChild(settingsTab.render()) const analysisTab = new AnalysisTab(self._api, self._events, self._opts) - optionViews.appendChild(analysisTab.render()) const debuggerTab = new DebuggerTab(self._api, self._events, self._opts) - optionViews.appendChild(debuggerTab.render()) const supportTab = new SupportTab(self._api, self._events, self._opts) - optionViews.appendChild(supportTab.render()) - const testTab = new TestTab(self._api, events, opts) - optionViews.appendChild(testTab.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.addTab('Test', 'testView', optionViews.querySelector('#testView')) - this._view.tabbedMenu.selectTabByTitle('Compile') + const testTab = new TestTab(self._api, self._events, self._opts) + self._view.tabbedMenu.addTab('Compile', 'compileView', compileTab.render()) + self._view.tabbedMenu.addTab('Run', 'runView', runTab.render()) + self._view.tabbedMenu.addTab('Settings', 'settingsView', settingsTab.render()) + self._view.tabbedMenu.addTab('Analysis', 'staticanalysisView', analysisTab.render()) + self._view.tabbedMenu.addTab('Debugger', 'debugView', debuggerTab.render()) + self._view.tabbedMenu.addTab('Support', 'supportView', supportTab.render()) + self._view.tabbedMenu.addTab('Test', 'testView', testTab.render()) + self._view.tabbedMenu.selectTabByTitle('Compile') self.pluginManager = new PluginManager(self._opts.pluginAPI, self._events) self._events.rhp.register('plugin-loadRequest', (json) => { const tab = new PluginTab({}, self._events, json) const content = tab.render() optionViews.appendChild(content) - this._view.tabbedMenu.addTab(json.title, 'plugin', content) + self._view.tabbedMenu.addTab(json.title, 'plugin', content) self.pluginManager.register(json, content) }) } @@ -133,14 +124,6 @@ module.exports = class RighthandPanel { } const css = csjs` - .menu { - display: flex; - background-color: ${styles.rightPanel.BackgroundColor_Pre}; - list-style: none; - margin: 0; - padding: 0; - } - .righthandpanel { display : flex; flex-direction : column;