Implemented another way of waiting for refresh of region before animation

This commit is contained in:
Cato Antonsen 2017-03-05 23:36:24 +01:00
parent 347a2977fa
commit 120b505361

View File

@ -249,14 +249,14 @@ var MM = (function() {
updateWrapperStates(); updateWrapperStates();
// Waiting for DOM-changes done in updateWrapperStates before we can start the animation. // Waiting for DOM-changes done in updateWrapperStates before we can start the animation.
setTimeout(function(){ var dummy = moduleWrapper.parentElement.parentElement.offsetHeight;
moduleWrapper.style.opacity = 1;
clearTimeout(module.showHideTimer); moduleWrapper.style.opacity = 1;
module.showHideTimer = setTimeout(function() {
if (typeof callback === "function") { callback(); } clearTimeout(module.showHideTimer);
}, speed); module.showHideTimer = setTimeout(function() {
}, 0); if (typeof callback === "function") { callback(); }
}, speed);
} }
}; };