From 4325fcdca2fa103e0973a7200467a05a12542a75 Mon Sep 17 00:00:00 2001 From: Tom Hirschberger Date: Tue, 11 Jan 2022 15:20:33 +0100 Subject: [PATCH] automatically add/remove a hidden/shown class to the module wrappers if they get hidden or shown --- js/main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/main.js b/js/main.js index bc128194..fa8db4a0 100644 --- a/js/main.js +++ b/js/main.js @@ -245,6 +245,8 @@ const MM = (function () { if (moduleWrapper !== null) { moduleWrapper.style.transition = "opacity " + speed / 1000 + "s"; moduleWrapper.style.opacity = 0; + moduleWrapper.className = moduleWrapper.className.split(" shown").join(""); + moduleWrapper.className += " hidden"; clearTimeout(module.showHideTimer); module.showHideTimer = setTimeout(function () { @@ -310,6 +312,8 @@ const MM = (function () { moduleWrapper.style.transition = "opacity " + speed / 1000 + "s"; // Restore the position. See hideModule() for more info. moduleWrapper.style.position = "static"; + moduleWrapper.className = moduleWrapper.className.split(" hidden").join(""); + moduleWrapper.className += " shown"; updateWrapperStates();