A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
module.js
-
This post is deleted! -
@hango from main.js
var showModule = function (module, speed, callback, options) { var hideModule = function (module, speed, callback, options) {
-
This post is deleted! -
@hango before the call to hideModule
there is a variable self set
self is used to avoid the ambiguity of ‘this’, as inside callbacks ‘this’ can point to the caller, NOT the context where it was intended.var self = this; < ----- self is initialized to the current 'this' context MM.hideModule( self, < -------------- should be 'this' ? speed,
so its the same
and in the call there is a required function (the callback), in this case created inlinefunction () { self.suspend(); // < --- make sure to use the right module context when this function is called // the compiler remembers that self was defined above callback(); // call the routine defined as callback },
-
This post is deleted!