close scheduler / screensaver divs when clicked outside

This commit is contained in:
Justin 2023-08-22 23:25:11 +08:00 committed by GitHub
parent bda162c0c6
commit 1812c63908
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3622,4 +3622,12 @@ function saveScreensaverSettings() {
}
// close scheduler or screensaver div
document.addEventListener("click", function(event) {
if (!document.getElementById("screensaver-div").contains(event.target) || !document.getElementById("scheduler-div").contains(event.target)) {
document.getElementById("screensaver-div").style.display = "none";
document.getElementById("scheduler-div").style.display = "none";
}
});