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

Function updateWrapperStates

js/main.js:430–445  ·  view source on GitHub ↗

* Checks for all positions if it has visible content. * If not, if will hide the position to prevent unwanted margins. * This method should be called by the show and hide methods. * * Example: * If the top_bar only contains the update notification. And no update is available, * the update noti

()

Source from the content-addressed store, hash-verified

428 * update notification is not visible.
429 */
430function updateWrapperStates () {
431 modulePositions.forEach(function (position) {
432 const wrapper = selectWrapper(position);
433 const moduleWrappers = wrapper.getElementsByClassName("module");
434
435 let showWrapper = false;
436 Array.prototype.forEach.call(moduleWrappers, function (moduleWrapper) {
437 if (moduleWrapper.style.position === "" || moduleWrapper.style.position === "static") {
438 showWrapper = true;
439 }
440 });
441
442 // move container definitions to main CSS
443 wrapper.className = showWrapper ? "container" : "container hidden";
444 });
445}
446
447/**
448 * Loads the core config from the server (already combined with the system defaults).

Callers 3

createDomObjectsFunction · 0.85
_hideModuleFunction · 0.85
_showModuleFunction · 0.85

Calls 1

selectWrapperFunction · 0.85

Tested by

no test coverage detected