fix registry

pull/1/head
yann300 6 years ago
parent c1b4f7365f
commit be654e323d
  1. 3
      src/app/tabs/settings-tab.js
  2. 7
      src/app/tabs/support-tab.js
  3. 6
      src/app/tabs/test-tab.js

@ -54,8 +54,7 @@ module.exports = class SettingsTab {
self._deps.compiler.setOptimize(self.data.optimize) self._deps.compiler.setOptimize(self.data.optimize)
self.data.currentTheme = self._components.themeStorage.get('theme') || 'light' self.data.currentTheme = self._components.themeStorage.get('theme') || 'light'
var compilerEvent = self._components.registry.get('compiler').event self._deps.compiler.event.register('compilerLoaded', (version) => self.setVersionText(version))
compilerEvent.register('compilerLoaded', (version) => self.setVersionText(version))
self.fetchAllVersion((allversions, selectedVersion) => { self.fetchAllVersion((allversions, selectedVersion) => {
self.data.allversions = allversions self.data.allversions = allversions
self.data.selectedVersion = selectedVersion self.data.selectedVersion = selectedVersion

@ -15,9 +15,12 @@ module.exports = class SupportTab {
self.data = { gitterIsLoaded: false } self.data = { gitterIsLoaded: false }
self._components = {} self._components = {}
self._components.registry = localRegistry || globalRegistry self._components.registry = localRegistry || globalRegistry
self._deps = {
app: self._components.registry.get('app').api
}
var appEvent = self._components.registry.get('app').event self._deps.app.event.register('tabChanged', (tabName) => {
appEvent.register('tabChanged', (tabName) => {
if (tabName !== 'Support' || self.data.gitterIsLoaded) return if (tabName !== 'Support' || self.data.gitterIsLoaded) return
const iframe = yo`<iframe class="${css.chatIframe}" src='https://gitter.im/ethereum/remix/~embed'>` const iframe = yo`<iframe class="${css.chatIframe}" src='https://gitter.im/ethereum/remix/~embed'>`
self._view.gitterIframe.parentNode.replaceChild(iframe, self._view.gitterIframe) self._view.gitterIframe.parentNode.replaceChild(iframe, self._view.gitterIframe)

@ -12,13 +12,13 @@ module.exports = class TestTab {
self._components.registry = localRegistry || globalRegistry self._components.registry = localRegistry || globalRegistry
// dependencies // dependencies
self._deps = { self._deps = {
fileManager: self._components.registry.get('filemanager').api fileManager: self._components.registry.get('filemanager').api,
app: self._components.registry.get('app').api
} }
self.data = {} self.data = {}
self._view.el = self.render() self._view.el = self.render()
var appEvent = self._components.registry.get('app').event self._deps.app.event.register('tabChanged', tabName => {
appEvent.register('tabChanged', tabName => {
if (tabName !== 'test') return if (tabName !== 'test') return
yo.update(self._view.el, self.render()) yo.update(self._view.el, self.render())
self._view.el.style.display = 'block' self._view.el.style.display = 'block'

Loading…
Cancel
Save