mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-29 12:39:45 +00:00
fix issue with show/hide callbacks
This commit is contained in:
parent
0a19570f2c
commit
54dda91726
@ -162,7 +162,8 @@ var MM = (function() {
|
|||||||
moduleWrapper.style.transition = "opacity " + speed / 1000 + "s";
|
moduleWrapper.style.transition = "opacity " + speed / 1000 + "s";
|
||||||
moduleWrapper.style.opacity = 0;
|
moduleWrapper.style.opacity = 0;
|
||||||
|
|
||||||
setTimeout(function() {
|
clearTimeout(module.showHideTimer);
|
||||||
|
module.showHideTimer = setTimeout(function() {
|
||||||
// To not take up any space, we just make the position absolute.
|
// To not take up any space, we just make the position absolute.
|
||||||
// since it's fade out anyway, we can see it lay above or
|
// since it's fade out anyway, we can see it lay above or
|
||||||
// below other modules. This works way better than adjusting
|
// below other modules. This works way better than adjusting
|
||||||
@ -189,7 +190,8 @@ var MM = (function() {
|
|||||||
moduleWrapper.style.position = "static";
|
moduleWrapper.style.position = "static";
|
||||||
moduleWrapper.style.opacity = 1;
|
moduleWrapper.style.opacity = 1;
|
||||||
|
|
||||||
setTimeout(function() {
|
clearTimeout(module.showHideTimer);
|
||||||
|
module.showHideTimer = setTimeout(function() {
|
||||||
if (typeof callback === "function") { callback(); }
|
if (typeof callback === "function") { callback(); }
|
||||||
}, speed);
|
}, speed);
|
||||||
|
|
||||||
|
@ -17,6 +17,9 @@ var Module = Class.extend({
|
|||||||
// Module config defaults.
|
// Module config defaults.
|
||||||
defaults: {},
|
defaults: {},
|
||||||
|
|
||||||
|
// Timer reference used for showHide animation callbacks.
|
||||||
|
showHideTimer: null,
|
||||||
|
|
||||||
/* init()
|
/* init()
|
||||||
* Is called when the module is instantiated.
|
* Is called when the module is instantiated.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user