rhp: refactor to class

pull/3094/head
serapath 7 years ago committed by yann300
parent 6082aeadb2
commit 39c970768e
  1. 15
      src/app/panels/righthand-panel.js

@ -17,8 +17,8 @@ const RunTab = require('../tabs/run-tab')
const EventManager = remixLib.EventManager const EventManager = remixLib.EventManager
const styles = styleguide.chooser() const styles = styleguide.chooser()
var prototype = { module.exports = class RighthandPanel {
constructor: function RighthandPanel (api = {}, events = {}, opts = {}) { constructor (api = {}, events = {}, opts = {}) {
const self = this const self = this
self._api = api self._api = api
self._events = events self._events = events
@ -81,12 +81,12 @@ var prototype = {
this._view.tabbedMenu.addTab(json.title, 'plugin', content) this._view.tabbedMenu.addTab(json.title, 'plugin', content)
self.pluginManager.register(json, content) self.pluginManager.register(json, content)
}) })
}, }
render: function () { render () {
const self = this const self = this
return self._view.element return self._view.element
}, }
init: function () { init () {
const self = this const self = this
// ;[...options.children].forEach((el) => { el.classList.add(css.options) }) // ;[...options.children].forEach((el) => { el.classList.add(css.options) })
@ -131,9 +131,6 @@ var prototype = {
} }
} }
} }
prototype.constructor.prototype = prototype
module.exports = prototype.constructor
const css = csjs` const css = csjs`
#righthand-panel { #righthand-panel {

Loading…
Cancel
Save