Skip to content

Commit 078a164

Browse files
author
NiallSmyth
committedSep 29, 2017
Initialise viewbridges ASAP. "complete" waits until everything including images are done.
Sometimes "interactive" gets skipped entirely, going directly to "complete" - we need to accept that too. Fix for IE10 not handling readyState == 'interactive' properly.
1 parent 15705f0 commit 078a164

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎resources/resource-manager.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,15 @@ window.resourceManager =
313313
var self = this;
314314

315315
var interval = setInterval(function () {
316-
if (document.readyState == "complete") {
316+
// IE10 and lower don't handle "interactive" properly - it fires before the DOM is loaded
317+
// Check for attachEvent to detect IE10 and lower (it was removed in IE11)
318+
// Otherwise if the readyState isn't "loading" then it's either "complete" or "interactive"
319+
if (document.attachEvent ? document.readyState === 'complete' : document.readyState !== 'loading') {
317320
clearInterval(interval);
318321

319322
self.documentReady = true;
320323
self.runWhenDocumentReady(callBack)
321324
}
322325
}, 11);
323326
}
324-
};
327+
};

0 commit comments

Comments
 (0)
Please sign in to comment.