From 38b65cd4a61ac948de11b269c5d3e6711cb75b16 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 14 Jan 2019 18:34:56 -0500 Subject: [PATCH] refactor & simplify support tab --- src/app/tabs/support-tab.js | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/src/app/tabs/support-tab.js b/src/app/tabs/support-tab.js index 7b16bb7a39..6844bfb94e 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 - } + loadContent () { + if (this.gitterIsLoaded) return - this._deps.app.event.register('tabChanged', (tabName) => { - if (tabName !== 'Support' || this.data.gitterIsLoaded) return - const iframe = yo`