From c2e90864ac21d4405bb7c37cd3253c59e8e67940 Mon Sep 17 00:00:00 2001 From: Cato Antonsen Date: Sun, 5 Mar 2017 22:23:05 +0100 Subject: [PATCH 1/4] Fixed missing animations on this.show() when module is alone in a region --- CHANGELOG.md | 1 + js/main.js | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) mode change 100644 => 100755 CHANGELOG.md mode change 100644 => 100755 js/main.js diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100644 new mode 100755 index 1138da27..d3918091 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Module currentWeather: check if temperature received from api is defined. - Fix an issue with module hidden status changing to `true` although lock string prevented showing it - Fix newsfeed module bug (removeStartTags) +- Fixed missing animation on `this.show(speed)` when module is alone in a region. ## [2.1.0] - 2016-12-31 diff --git a/js/main.js b/js/main.js old mode 100644 new mode 100755 index e1a13d8a..a81e3530 --- a/js/main.js +++ b/js/main.js @@ -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); } }; From 347a2977fad56891750431856df877377c562e51 Mon Sep 17 00:00:00 2001 From: Cato Antonsen Date: Sun, 5 Mar 2017 22:46:48 +0100 Subject: [PATCH 2/4] Removed trailing spaces --- js/main.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/main.js b/js/main.js index a81e3530..57f9ac25 100755 --- a/js/main.js +++ b/js/main.js @@ -245,15 +245,13 @@ var MM = (function() { moduleWrapper.style.transition = "opacity " + speed / 1000 + "s"; // Restore the postition. See hideModule() for more info. moduleWrapper.style.position = "static"; - + updateWrapperStates(); // 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(); } From 120b50536167ac59b3f5d2c779ad0d065d324f94 Mon Sep 17 00:00:00 2001 From: Cato Antonsen Date: Sun, 5 Mar 2017 23:36:24 +0100 Subject: [PATCH 3/4] 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); } }; From 219021873df330ea418031b95a06754cd944fe70 Mon Sep 17 00:00:00 2001 From: Cato Antonsen Date: Sun, 5 Mar 2017 23:42:13 +0100 Subject: [PATCH 4/4] Removed trailing space --- js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/main.js b/js/main.js index 4aa64a79..ad1486ca 100755 --- a/js/main.js +++ b/js/main.js @@ -249,8 +249,8 @@ var MM = (function() { updateWrapperStates(); // Waiting for DOM-changes done in updateWrapperStates before we can start the animation. - var dummy = moduleWrapper.parentElement.parentElement.offsetHeight; - + var dummy = moduleWrapper.parentElement.parentElement.offsetHeight; + moduleWrapper.style.opacity = 1; clearTimeout(module.showHideTimer);