* 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)
| 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; |