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 no… the MM functions locate modules
then u have the module object and call hide on it
from my SleepWake moduleMM.getModules().enumerate((module) => { // if the module is already hidden if(module.hidden==true) // save it for wake up {self.previously_hidden.push(module.identifier);} else // hide this module {module.hide(1000);} });
https://docs.magicmirror.builders/development/helper-methods.html#module-selection
-
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!