Only allow night mode enabled manually or automatically, but not both at the same time (again fixes #71)

This commit is contained in:
Bernd Bestel 2019-09-18 19:43:33 +02:00
parent 991706920f
commit 8f798a94d1
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -4,6 +4,10 @@
if (value)
{
$("body").addClass("night-mode");
// Force disable auto night mode when night mode is enabled
$("#auto-night-mode-enabled").prop("checked", false);
$("#auto-night-mode-enabled").trigger("change");
}
else
{
@ -21,6 +25,13 @@ $("#auto-night-mode-enabled").on("change", function()
{
$("body").removeClass("night-mode");
}
// Force disable night mode when auto night mode is enabled
if (value)
{
$("#night-mode-enabled").prop("checked", false);
$("#night-mode-enabled").trigger("change");
}
});
$(document).on("keyup", "#auto-night-mode-time-range-from, #auto-night-mode-time-range-to", function()