quick fixes

pull/1/head
Grandschtroumpf 6 years ago committed by yann300
parent 46bca1096c
commit 669761464e
  1. 6
      src/app.js
  2. 2
      src/app/editor/editor.js
  3. 2
      src/app/tabs/settings-tab.js
  4. 8
      src/app/tabs/theme-module.js

@ -388,6 +388,10 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
var fileManager = self._components.fileManager
registry.put({api: fileManager, name: 'filemanager'})
// ----------------- theme module ----------------------------
const themeModule = new ThemeModule()
registry.put({api: themeModule, name: 'themeModule'})
// ----------------- editor panel ----------------------
self._components.editorpanel = new EditorPanel(appStore, appManager, mainPanelComponent)
registry.put({ api: self._components.editorpanel, name: 'editorpanel' })
@ -413,11 +417,9 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconsComponent) // eslint-disable-line
const mainPanelApi = new SwapPanelApi(mainPanelComponent, verticalIconsComponent) // eslint-disable-line
const verticalIconsApi = new VerticalIconsApi(verticalIconsComponent) // eslint-disable-line
const themeModule = new ThemeModule()
registry.put({api: appManager.proxy(), name: 'pluginmanager'})
registry.put({api: verticalIconsApi, name: 'verticalicon'})
registry.put({api: themeModule, name: 'themeModule'})
pluginManagerComponent.setApp(appManager)
pluginManagerComponent.setStore(appStore)

@ -71,7 +71,7 @@ class Editor {
'light': 'chrome',
'dark': 'chaos'
}
this._deps.themeModule.events.on('switchTheme', (type) => {
this._deps.themeModule.events.on('themeChanged', (type) => {
this.setTheme(type)
})

@ -44,7 +44,7 @@ module.exports = class SettingsTab extends ApiFactory {
}
createThemeCheckies () {
let themes = this._deps.themeModule.getThemes()
function onswitchTheme (event, name) {
const onswitchTheme = (event, name) => {
this._deps.themeModule.switchTheme(name)
}
if (themes) {

@ -23,7 +23,7 @@ export class ThemeModule extends ApiFactory {
super()
this.events = new EventEmitter()
this.storage = new Storage('style:')
this.themes = themes.reduce(theme => ({ [theme.name]: theme }), {})
this.themes = themes.reduce((acc, theme) => ({ ...acc, [theme.name]: theme }), {})
this.active = this.storage.exists('theme') ? this.storage.get('theme') : 'Cerulean'
}
@ -37,12 +37,12 @@ export class ThemeModule extends ApiFactory {
/** Return the active theme */
currentTheme () {
return this.theme[this.active]
return this.themes[this.active]
}
/** Returns all themes as an array */
getThemes () {
return Object.keys(this.themes).map(key => this.themes(key))
return Object.keys(this.themes).map(key => this.themes[key])
}
/**
@ -58,6 +58,6 @@ export class ThemeModule extends ApiFactory {
this.storage.set('theme', next)
document.getElementById('theme-link').setAttribute('href', nextTheme.url)
document.documentElement.style.setProperty('--theme', nextTheme.quality)
this.event.emit('switchTheme', nextTheme.quality)
this.events.emit('themeChanged', nextTheme.quality)
}
}

Loading…
Cancel
Save