Merge pull request #1897 from ethereum/issue#1896-theme_changed_event

Issue#1896 theme changed event
pull/1/head
yann300 6 years ago committed by GitHub
commit 0cca38bd8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/app/components/vertical-icons-component.js
  2. 4
      src/app/editor/editor.js
  3. 2
      src/app/tabs/theme-module.js
  4. 4
      src/app/ui/landing-page/landing-page.js

@ -35,8 +35,8 @@ class VerticalIconComponent {
this.store.event.on('remove', (api) => { })
let themeModule = globalRegistry.get('themeModule').api
themeModule.events.on('themeChanged', (type) => {
this.onThemeChanged(type)
themeModule.events.on('themeChanged', (theme) => {
this.onThemeChanged(theme.quality)
})
}

@ -52,8 +52,8 @@ class Editor {
'light': 'chrome',
'dark': 'chaos'
}
this._deps.themeModule.events.on('themeChanged', (type) => {
this.setTheme(type)
this._deps.themeModule.events.on('themeChanged', (theme) => {
this.setTheme(theme.quality)
})
// Init

@ -57,6 +57,6 @@ export class ThemeModule extends BaseApi {
document.getElementById('theme-link').setAttribute('href', nextTheme.url)
document.documentElement.style.setProperty('--theme', nextTheme.quality)
if (themeName) this.active = themeName
this.events.emit('themeChanged', nextTheme.quality)
this.events.emit('themeChanged', nextTheme)
}
}

@ -161,8 +161,8 @@ export class LandingPage extends BaseApi {
globalRegistry.get('verticalicon').api.select('fileExplorers')
}
globalRegistry.get('themeModule').api.events.on('themeChanged', (type) => {
const invert = type === 'dark' ? 1 : 0
globalRegistry.get('themeModule').api.events.on('themeChanged', (theme) => {
const invert = theme.quality === 'dark' ? 1 : 0
const img = document.getElementById('remixLogo')
if (img) {
img.style.filter = `invert(${invert})`

Loading…
Cancel
Save