MCPcopy
hub / github.com/MagicMirrorOrg/MagicMirror / updateDom

Function updateDom

js/main.js:657–672  ·  view source on GitHub ↗

* Update the dom for a specific module. * @param {Module} module The module that needs an update. * @param {object|number} [updateOptions] The (optional) number of microseconds for the animation or object with updateOptions (speed/animates)

(module, updateOptions)

Source from the content-addressed store, hash-verified

655 * @param {object|number} [updateOptions] The (optional) number of microseconds for the animation or object with updateOptions (speed/animates)
656 */
657 async updateDom (module, updateOptions) {
658 if (!(module instanceof Module)) {
659 Log.error("updateDom: Sender should be a module.");
660 return;
661 }
662
663 if (!module.data.position) {
664 Log.warn("module tries to update the DOM without being displayed.");
665 return;
666 }
667
668 // Further implementation is done in the private method.
669 await _updateDom(module, updateOptions);
670 // Once the update is complete and rendered, send a notification to the module that the DOM has been updated
671 _sendNotification("MODULE_DOM_UPDATED", null, null, module);
672 },
673
674 /**
675 * Returns a collection of all modules currently active.

Callers

nothing calls this directly

Calls 2

_updateDomFunction · 0.85
_sendNotificationFunction · 0.85

Tested by

no test coverage detected