mirror of
https://github.com/liriliri/eruda.git
synced 2026-04-13 10:48:35 +08:00
release: v2.6.1
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
extend,
|
||||
} from '../lib/util'
|
||||
import evalCss from '../lib/evalCss'
|
||||
import { isDarkTheme } from '../lib/themes'
|
||||
import LunaNotification from 'luna-notification'
|
||||
|
||||
export default class DevTools extends Emitter {
|
||||
@@ -156,7 +157,7 @@ export default class DevTools extends Emitter {
|
||||
|
||||
this._setTransparency(cfg.get('transparency'))
|
||||
this._setDisplaySize(cfg.get('displaySize'))
|
||||
evalCss.setTheme(cfg.get('theme'))
|
||||
this._setTheme(cfg.get('theme'))
|
||||
|
||||
cfg.on('change', (key, val) => {
|
||||
switch (key) {
|
||||
@@ -165,7 +166,7 @@ export default class DevTools extends Emitter {
|
||||
case 'displaySize':
|
||||
return this._setDisplaySize(val)
|
||||
case 'theme':
|
||||
return evalCss.setTheme(val)
|
||||
return this._setTheme(val)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -193,6 +194,16 @@ export default class DevTools extends Emitter {
|
||||
this._navBar.destroy()
|
||||
this._$el.remove()
|
||||
}
|
||||
_setTheme(theme) {
|
||||
const { $container } = this
|
||||
|
||||
if (isDarkTheme(theme)) {
|
||||
$container.addClass('eruda-dark')
|
||||
} else {
|
||||
$container.rmClass('eruda-dark')
|
||||
}
|
||||
evalCss.setTheme(theme)
|
||||
}
|
||||
_setTransparency(opacity) {
|
||||
if (!isNum(opacity)) return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user