rhp: refactor rhp/tabbedMenu relation

pull/3094/head
serapath 7 years ago committed by yann300
parent 789c791576
commit b97f5c1910
  1. 39
      src/app/panels/righthand-panel.js

@ -38,9 +38,7 @@ module.exports = class RighthandPanel {
<div id="righthand-panel" class=${css.righthandpanel}> <div id="righthand-panel" class=${css.righthandpanel}>
${self._view.dragbar} ${self._view.dragbar}
<div id="header" class=${css.header}> <div id="header" class=${css.header}>
<div class=${css.menu}> ${options}
${options}
</div>
${optionViews} ${optionViews}
</div> </div>
</div> </div>
@ -51,34 +49,27 @@ module.exports = class RighthandPanel {
self._events.rhp = self.event self._events.rhp = self.event
const compileTab = new CompileTab(self._api, self._events, self._opts) const compileTab = new CompileTab(self._api, self._events, self._opts)
optionViews.appendChild(compileTab.render())
const runTab = new RunTab(self._api, self._events, self._opts) const runTab = new RunTab(self._api, self._events, self._opts)
optionViews.appendChild(runTab.render())
const settingsTab = new SettingsTab(self._api, self._events, self._opts) const settingsTab = new SettingsTab(self._api, self._events, self._opts)
optionViews.appendChild(settingsTab.render())
const analysisTab = new AnalysisTab(self._api, self._events, self._opts) const analysisTab = new AnalysisTab(self._api, self._events, self._opts)
optionViews.appendChild(analysisTab.render())
const debuggerTab = new DebuggerTab(self._api, self._events, self._opts) const debuggerTab = new DebuggerTab(self._api, self._events, self._opts)
optionViews.appendChild(debuggerTab.render())
const supportTab = new SupportTab(self._api, self._events, self._opts) const supportTab = new SupportTab(self._api, self._events, self._opts)
optionViews.appendChild(supportTab.render()) const testTab = new TestTab(self._api, self._events, self._opts)
const testTab = new TestTab(self._api, events, opts) self._view.tabbedMenu.addTab('Compile', 'compileView', compileTab.render())
optionViews.appendChild(testTab.render()) self._view.tabbedMenu.addTab('Run', 'runView', runTab.render())
this._view.tabbedMenu.addTab('Compile', 'compileView', optionViews.querySelector('#compileTabView')) self._view.tabbedMenu.addTab('Settings', 'settingsView', settingsTab.render())
this._view.tabbedMenu.addTab('Run', 'runView', optionViews.querySelector('#runTabView')) self._view.tabbedMenu.addTab('Analysis', 'staticanalysisView', analysisTab.render())
this._view.tabbedMenu.addTab('Settings', 'settingsView', optionViews.querySelector('#settingsView')) self._view.tabbedMenu.addTab('Debugger', 'debugView', debuggerTab.render())
this._view.tabbedMenu.addTab('Analysis', 'staticanalysisView', optionViews.querySelector('#staticanalysisView')) self._view.tabbedMenu.addTab('Support', 'supportView', supportTab.render())
this._view.tabbedMenu.addTab('Debugger', 'debugView', optionViews.querySelector('#debugView')) self._view.tabbedMenu.addTab('Test', 'testView', testTab.render())
this._view.tabbedMenu.addTab('Support', 'supportView', optionViews.querySelector('#supportView')) self._view.tabbedMenu.selectTabByTitle('Compile')
this._view.tabbedMenu.addTab('Test', 'testView', optionViews.querySelector('#testView'))
this._view.tabbedMenu.selectTabByTitle('Compile')
self.pluginManager = new PluginManager(self._opts.pluginAPI, self._events) self.pluginManager = new PluginManager(self._opts.pluginAPI, self._events)
self._events.rhp.register('plugin-loadRequest', (json) => { self._events.rhp.register('plugin-loadRequest', (json) => {
const tab = new PluginTab({}, self._events, json) const tab = new PluginTab({}, self._events, json)
const content = tab.render() const content = tab.render()
optionViews.appendChild(content) optionViews.appendChild(content)
this._view.tabbedMenu.addTab(json.title, 'plugin', content) self._view.tabbedMenu.addTab(json.title, 'plugin', content)
self.pluginManager.register(json, content) self.pluginManager.register(json, content)
}) })
} }
@ -133,14 +124,6 @@ module.exports = class RighthandPanel {
} }
const css = csjs` const css = csjs`
.menu {
display: flex;
background-color: ${styles.rightPanel.BackgroundColor_Pre};
list-style: none;
margin: 0;
padding: 0;
}
.righthandpanel { .righthandpanel {
display : flex; display : flex;
flex-direction : column; flex-direction : column;

Loading…
Cancel
Save