mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
21 lines
399 B
JavaScript
21 lines
399 B
JavaScript
$("#night-mode-enabled").on("change", function()
|
|
{
|
|
var value = $(this).is(":checked");
|
|
window.localStorage.setItem("night_mode", value);
|
|
|
|
if (value)
|
|
{
|
|
$("body").addClass("night-mode");
|
|
}
|
|
else
|
|
{
|
|
$("body").removeClass("night-mode");
|
|
}
|
|
});
|
|
|
|
if (window.localStorage.getItem("night_mode") === "true")
|
|
{
|
|
$("body").addClass("night-mode");
|
|
$("#night-mode-enabled").prop("checked", true);
|
|
}
|