mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 18:26:00 +00:00
Only allow night mode enabled manually or automatically, but not both at the same time (again fixes #71)
This commit is contained in:
@@ -4,6 +4,10 @@
|
|||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
$("body").addClass("night-mode");
|
$("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
|
else
|
||||||
{
|
{
|
||||||
@@ -21,6 +25,13 @@ $("#auto-night-mode-enabled").on("change", function()
|
|||||||
{
|
{
|
||||||
$("body").removeClass("night-mode");
|
$("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()
|
$(document).on("keyup", "#auto-night-mode-time-range-from, #auto-night-mode-time-range-to", function()
|
||||||
|
Reference in New Issue
Block a user