rhp: refactor to prepare for class

pull/1/head
serapath 7 years ago committed by yann300
parent a02f18b08c
commit ad4c265d90
  1. 20
      src/app/panels/righthand-panel.js

@ -17,7 +17,7 @@ const RunTab = require('../tabs/run-tab')
const EventManager = remixLib.EventManager const EventManager = remixLib.EventManager
const styles = styleguide.chooser() const styles = styleguide.chooser()
module.exports = function RighthandPanel (api = {}, events = {}, opts = {}) { function RighthandPanel (api = {}, events = {}, opts = {}) {
const self = this const self = this
self._api = api self._api = api
self._events = events self._events = events
@ -80,11 +80,16 @@ module.exports = function RighthandPanel (api = {}, events = {}, opts = {}) {
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)
}) })
}
self.render = function () { return self._view.element } var prototype = {
constructor: RighthandPanel,
self.init = function () { render: function () {
;[...options.children].forEach((el) => { el.classList.add(css.options) }) const self = this
return self._view.element
},
init: function () {
const self = this
// ;[...options.children].forEach((el) => { el.classList.add(css.options) })
// ----------------- resizeable ui --------------- // ----------------- resizeable ui ---------------
const limit = 60 const limit = 60
@ -127,6 +132,9 @@ module.exports = function RighthandPanel (api = {}, events = {}, opts = {}) {
} }
} }
} }
prototype.constructor.prototype = prototype
module.exports = prototype.constructor
const css = csjs` const css = csjs`
#righthand-panel { #righthand-panel {

Loading…
Cancel
Save