mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-25 00:50:29 +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
|
@ -754,7 +754,20 @@ $(document).on("click", ".js-toggle-password", function(e) {
|
|||
$(function() {
|
||||
$('#theme-select').change(function() {
|
||||
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