slight update of code from our conversation

pull/1/head
Rob Stupay 6 years ago
parent 8a15fb7ce3
commit 7aee52fc88
  1. 2
      src/app.js
  2. 9
      src/app/components/plugin-manager-component.js
  3. 7
      src/app/components/swap-panel-api.js

@ -445,7 +445,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
type: 'solidityCompile', type: 'solidityCompile',
methods: [], methods: [],
} }
appManager.addPlugin({json: compileTabProfile, api: compileTab}) appManager.addPlugin({json: compileTabProfile, api: new InternalModule(compileTab) })
const testTab = new TestTab(self._components.registry, compileTab) const testTab = new TestTab(self._components.registry, compileTab)
const testTabProfile = { const testTabProfile = {

@ -25,11 +25,15 @@ class PluginManagerComponent {
} }
_activate(item) { _activate(item) {
this.appManager.activate(item) this.event.emit('activation', item)
} }
_deactivate(item) { _deactivate(item) {
this.appManager.deactivate(item) this.event.emit('deactivation', item)
}
_addPlugin(url){
this.event.emit('plugin loading', url)
} }
renderItem (item) { renderItem (item) {
@ -42,6 +46,7 @@ class PluginManagerComponent {
<button onclick=${() => { self._activate(item) }} ><button> <button onclick=${() => { self._activate(item) }} ><button>
<button onclick=${() => { self._deactivate(item) }} ><button> <button onclick=${() => { self._deactivate(item) }} ><button>
</div> </div>
<button onclick=${} ><button>
` `
} }
} }

@ -8,7 +8,7 @@ const styles = styleguide.chooser()
const EventManager = remixLib.EventManager const EventManager = remixLib.EventManager
class SwapPanelApi { class SwapPanelApi {
constructor (swapPanelComponent) { constructor (swapPanelComponent, pluginManagerApi) {
this.component = swapPanelComponent this.component = swapPanelComponent
} }
@ -20,6 +20,11 @@ class SwapPanelApi {
// add the DOM to the swappanel // add the DOM to the swappanel
this.component.addView(viewTitle, contents) this.component.addView(viewTitle, contents)
} }
activate() {
this.event.emit(activated)
this.pluginManagerApi.activated(this.type)
}
} }

Loading…
Cancel
Save