Unverified Commit 0cca38bd authored by yann300's avatar yann300 Committed by GitHub

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

Issue#1896 theme changed event
parents d266db68 6de2c68f
......@@ -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})`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment