MCPcopy
hub / github.com/marcj/css-element-queries / setupElement

Function setupElement

src/ElementQueries.js:169–179  ·  view source on GitHub ↗

* @param {HTMLElement} element * @param {Object} id

(element, id)

Source from the content-addressed store, hash-verified

167 * @param {Object} id
168 */
169 function setupElement(element, id) {
170 if (!element.elementQueriesSetupInformation) {
171 element.elementQueriesSetupInformation = new SetupInformation(element, id);
172 }
173
174 if (!element.elementQueriesSensor) {
175 element.elementQueriesSensor = new ResizeSensor(element, function () {
176 element.elementQueriesSetupInformation.call();
177 });
178 }
179 }
180
181 /**
182 * Stores rules to the selector that should be applied once resized.

Callers 2

ElementQueriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected