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!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login