automatically add/remove a hidden/shown class to the module wrappers if they get hidden or shown

This commit is contained in:
Tom Hirschberger 2022-01-11 15:20:33 +01:00
parent ad66c02735
commit 4325fcdca2

View file

@ -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();