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

1
CHANGELOG.md Normal file → Executable file
View File

@ -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

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);
}
};