mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-21 23:20:22 +00:00
Fix night mode when changing theme
Signed-off-by: Nestoras Sdoukos <sdoukos@libre.space>
This commit is contained in:
parent
5b27f528c9
commit
02ac421010
1 changed files with 15 additions and 2 deletions
|
@ -753,8 +753,21 @@ $(document).on("click", ".js-toggle-password", function(e) {
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$('#theme-select').change(function() {
|
$('#theme-select').change(function() {
|
||||||
var theme = themes[$( "#theme-select" ).val() ];
|
var theme = themes[$( "#theme-select" ).val() ];
|
||||||
set_theme(theme);
|
|
||||||
|
var hasDarkTheme = theme === 'custom.php' ||
|
||||||
|
theme === 'material-light.php';
|
||||||
|
var nightModeChecked = $("#night-mode").prop("checked");
|
||||||
|
|
||||||
|
if (nightModeChecked && hasDarkTheme) {
|
||||||
|
if (theme === "custom.php") {
|
||||||
|
set_theme("lightsout.php");
|
||||||
|
} else if (theme === "material-light.php") {
|
||||||
|
set_theme("material-dark.php");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
set_theme(theme);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue