Commit c7358b4b authored by Rob Stupay's avatar Rob Stupay

update for testing

parent be3ea207
This diff is collapsed.
......@@ -8,19 +8,15 @@ const styles = styleguide.chooser()
const EventManager = remixLib.EventManager
class PluginManagerApi {
constructor (swapPanelComponent) {
constructor (swapPanelComponent, pluginManagerComponent, appManager) {
this.component = swapPanelComponent
}
/*
viewTitle: string
content: DOM element
*/
addView(viewTitle, content) {
// add the DOM to the swappanel
this.component.addView(viewTitle, contents)
this.appManager = appManager
appManager.event.register('pluginLoaded', (item) => {
pluginManagerComponent.addItem(item)
})
pluginManagerComponent.event.on('activation', (item) => this.event.emit('activation', item))
pluginManagerComponent.event.on('deactivation', (item) => this.event.emit('deactivation', item))
}
}
module.exports = SwapPanelApi
......@@ -8,11 +8,7 @@ const styles = styleguide.chooser()
const EventManager = remixLib.EventManager
class PluginManagerComponent {
constructor (appManager) {
this.appManager = appManager
appManager.event.register('pluginLoaded', () => {
// call this.renderItem
})
constructor () {
}
render () {
......@@ -24,6 +20,11 @@ class PluginManagerComponent {
`
}
addItem (item) {
// add to appManager and then render
renderItem(item)
}
_activate(item) {
this.event.emit('activation', item)
}
......@@ -32,10 +33,6 @@ class PluginManagerComponent {
this.event.emit('deactivation', item)
}
_addPlugin(url){
this.event.emit('plugin loading', url)
}
renderItem (item) {
var self = this
......@@ -46,7 +43,6 @@ class PluginManagerComponent {
<button onclick=${() => { self._activate(item) }} ><button>
<button onclick=${() => { self._deactivate(item) }} ><button>
</div>
<button onclick=${} ><button>
`
}
}
......
......@@ -8,7 +8,8 @@ const styles = styleguide.chooser()
// API
class VerticalIconsApi {
constructor(verticalIconsComponent) {
constructor(verticalIconsComponent, pluginManagerApi) {
pluginManagerApi.event.on('activate', (module) => verticalIconsComponent.addIcon(module) )
this.component = verticalIconsComponent
}
......
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