MCPcopy Index your code
hub / github.com/MagicMirrorOrg/MagicMirror / selectWrapper

Function selectWrapper

js/main.js:87–96  ·  view source on GitHub ↗

* Select the wrapper dom object for a specific position. * @param {string} position The name of the position. * @returns {HTMLElement | void} the wrapper element

(position)

Source from the content-addressed store, hash-verified

85 * @returns {HTMLElement | void} the wrapper element
86 */
87function selectWrapper (position) {
88 const classes = position.replace("_", " ");
89 const parentWrapper = document.getElementsByClassName(classes);
90 if (parentWrapper.length > 0) {
91 const wrapper = parentWrapper[0].getElementsByClassName("container");
92 if (wrapper.length > 0) {
93 return wrapper[0];
94 }
95 }
96}
97
98/**
99 * Send a notification to all modules.

Callers 2

createDomObjectsFunction · 0.85
updateWrapperStatesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected