diff --git a/src/app.js b/src/app.js index cefc861f79..5f8525fb05 100644 --- a/src/app.js +++ b/src/app.js @@ -438,10 +438,14 @@ Please make a backup of your contracts and start using http://remix.ethereum.org settings: new SettingsTab(self._components.registry), analysis: new AnalysisTab(registry), debug: new DebuggerTab(self._components.registry), - support: new SupportTab(self._components.registry), + support: new SupportTab(), test: new TestTab(self._components.registry, compileTab) } + registry.get('app').api.event.register('tabChanged', (tabName) => { + if (tabName === 'Support') tabs.support.loadTab() + }) + let transactionContextAPI = { getAddress: (cb) => { cb(null, $('#txorigin').val()) diff --git a/src/app/tabs/support-tab.js b/src/app/tabs/support-tab.js index 153cc5a4a6..316d552afa 100644 --- a/src/app/tabs/support-tab.js +++ b/src/app/tabs/support-tab.js @@ -1,34 +1,22 @@ const yo = require('yo-yo') var css = require('./styles/support-tab-styles') -var globalRegistry = require('../../global/registry') - -var EventManager = require('../../lib/events') - class SupportTab { constructor (localRegistry) { - this.event = new EventManager() - this.el = null this.gitterIframe = '' + this.gitterIsLoaded = false + } - this.data = { gitterIsLoaded: false } - this._components = {} - this._components.registry = localRegistry || globalRegistry - - this._deps = { - app: this._components.registry.get('app').api - } + loadTab () { + if (this.gitterIsLoaded) return - this._deps.app.event.register('tabChanged', (tabName) => { - if (tabName !== 'Support' || this.data.gitterIsLoaded) return - const iframe = yo`