From 1812c63908fab67ab179228f28e6370ed3d3192a Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 22 Aug 2023 23:25:11 +0800 Subject: [PATCH] close scheduler / screensaver divs when clicked outside --- static/app.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/static/app.js b/static/app.js index 85864bb..033b118 100755 --- a/static/app.js +++ b/static/app.js @@ -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"; + } +}); +