From 120b50536167ac59b3f5d2c779ad0d065d324f94 Mon Sep 17 00:00:00 2001 From: Cato Antonsen Date: Sun, 5 Mar 2017 23:36:24 +0100 Subject: [PATCH] Implemented another way of waiting for refresh of region before animation --- js/main.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js/main.js b/js/main.js index 57f9ac25..4aa64a79 100755 --- a/js/main.js +++ b/js/main.js @@ -249,14 +249,14 @@ var MM = (function() { updateWrapperStates(); // Waiting for DOM-changes done in updateWrapperStates before we can start the animation. - setTimeout(function(){ - moduleWrapper.style.opacity = 1; + var dummy = moduleWrapper.parentElement.parentElement.offsetHeight; + + moduleWrapper.style.opacity = 1; - clearTimeout(module.showHideTimer); - module.showHideTimer = setTimeout(function() { - if (typeof callback === "function") { callback(); } - }, speed); - }, 0); + clearTimeout(module.showHideTimer); + module.showHideTimer = setTimeout(function() { + if (typeof callback === "function") { callback(); } + }, speed); } };