|
246 | 246 | this.withTracking = withTracking; |
247 | 247 | for (var i = 0, j = document.styleSheets.length; i < j; i++) { |
248 | 248 | try { |
249 | | - readRules(document.styleSheets[i].cssText || document.styleSheets[i].cssRules || document.styleSheets[i].rules); |
| 249 | + readRules(document.styleSheets[i].cssRules || document.styleSheets[i].rules || document.styleSheets[i].cssText); |
250 | 250 | } catch(e) { |
251 | 251 | if (e.name !== 'SecurityError') { |
252 | 252 | throw e; |
|
315 | 315 | ElementQueries.instance.init(ElementQueries.withTracking); |
316 | 316 | }; |
317 | 317 |
|
318 | | - var domLoaded = function (callback) { |
319 | | - /* Internet Explorer */ |
320 | | - /*@cc_on |
321 | | - @if (@_win32 || @_win64) |
322 | | - document.write('<script id="ieScriptLoad" defer src="//:"><\/script>'); |
323 | | - document.getElementById('ieScriptLoad').onreadystatechange = function() { |
324 | | - if (this.readyState == 'complete') { |
325 | | - callback(); |
326 | | - } |
327 | | - }; |
328 | | - @end @*/ |
329 | | - /* Mozilla, Chrome, Opera */ |
330 | | - if (document.addEventListener) { |
331 | | - document.addEventListener('DOMContentLoaded', callback, false); |
332 | | - } |
333 | | - /* Safari, iCab, Konqueror */ |
334 | | - if (/KHTML|WebKit|iCab/i.test(navigator.userAgent)) { |
335 | | - var DOMLoadTimer = setInterval(function () { |
336 | | - if (/loaded|complete/i.test(document.readyState)) { |
337 | | - callback(); |
338 | | - clearInterval(DOMLoadTimer); |
339 | | - } |
340 | | - }, 10); |
341 | | - } |
342 | | - /* Other web browsers */ |
343 | | - window.onload = callback; |
344 | | - }; |
345 | | - |
346 | | - if (window.addEventListener) { |
347 | | - window.addEventListener('load', ElementQueries.init, false); |
348 | | - } else { |
349 | | - window.attachEvent('onload', ElementQueries.init); |
350 | | - } |
351 | | - domLoaded(ElementQueries.init); |
352 | | - |
353 | 318 | })(); |
0 commit comments