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

Function queueQuery

src/ElementQueries.js:189–205  ·  view source on GitHub ↗

* Stores rules to the selector that should be applied once resized. * * @param {String} selector * @param {String} mode min|max * @param {String} property width|height * @param {String} value

(selector, mode, property, value)

Source from the content-addressed store, hash-verified

187 * @param {String} value
188 */
189 function queueQuery(selector, mode, property, value) {
190 if (typeof(allQueries[selector]) === 'undefined') {
191 allQueries[selector] = [];
192 // add animation to trigger animationstart event, so we know exactly when a element appears in the DOM
193
194 var id = idToSelectorMapping.length;
195 cssStyleElement.innerHTML += '\n' + selector + ' {animation: 0.1s element-queries;}';
196 cssStyleElement.innerHTML += '\n' + selector + ' > .resize-sensor {min-width: '+id+'px;}';
197 idToSelectorMapping.push(selector);
198 }
199
200 allQueries[selector].push({
201 mode: mode,
202 property: property,
203 value: value
204 });
205 }
206
207 function getQuery(container) {
208 var query;

Callers 1

extractQueryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected