Commit ad4c265d authored by serapath's avatar serapath Committed by yann300

rhp: refactor to prepare for class

parent a02f18b0
...@@ -17,7 +17,7 @@ const RunTab = require('../tabs/run-tab') ...@@ -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 = {}) { ...@@ -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 = {}) { ...@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment