mirror of
https://github.com/heyman/heynote.git
synced 2024-11-25 17:33:31 +01:00
Rename function
This commit is contained in:
parent
eaccfd35da
commit
d02075f343
@ -34,7 +34,7 @@
|
|||||||
this.theme = mode.computed
|
this.theme = mode.computed
|
||||||
this.systemTheme = mode.theme
|
this.systemTheme = mode.theme
|
||||||
})
|
})
|
||||||
const onChangeCallback = (theme) => {
|
const onThemeChange = (theme) => {
|
||||||
this.theme = theme
|
this.theme = theme
|
||||||
if (theme === "system") {
|
if (theme === "system") {
|
||||||
document.body.setAttribute("theme", window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light")
|
document.body.setAttribute("theme", window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light")
|
||||||
@ -42,8 +42,8 @@
|
|||||||
document.body.setAttribute("theme", theme)
|
document.body.setAttribute("theme", theme)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onChangeCallback(window.heynote.themeMode.initial)
|
onThemeChange(window.heynote.themeMode.initial)
|
||||||
window.heynote.themeMode.onChange(onChangeCallback)
|
window.heynote.themeMode.onChange(onThemeChange)
|
||||||
window.heynote.onSettingsChange((settings) => {
|
window.heynote.onSettingsChange((settings) => {
|
||||||
this.settings = settings
|
this.settings = settings
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user