Fixed missing animations on this.show() when module is alone in a region

This commit is contained in:
Cato Antonsen
2017-03-05 22:23:05 +01:00
parent bd0de83d31
commit c2e90864ac
2 changed files with 12 additions and 6 deletions

17
js/main.js Normal file → Executable file
View File

@@ -245,15 +245,20 @@ var MM = (function() {
moduleWrapper.style.transition = "opacity " + speed / 1000 + "s";
// Restore the postition. See hideModule() for more info.
moduleWrapper.style.position = "static";
moduleWrapper.style.opacity = 1;
updateWrapperStates();
clearTimeout(module.showHideTimer);
module.showHideTimer = setTimeout(function() {
if (typeof callback === "function") { callback(); }
}, speed);
// Waiting for DOM-changes done in updateWrapperStates before we can start the animation.
setTimeout(function(){
moduleWrapper.style.opacity = 1;
clearTimeout(module.showHideTimer);
module.showHideTimer = setTimeout(function() {
if (typeof callback === "function") { callback(); }
}, speed);
}, 0);
}
};