Skip to content

Commit

Permalink
add extra check if dom is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioCrisostomo committed Jan 23, 2015
1 parent e1a153c commit 0dbb4d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Source/Utilities/DOMReady.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ if (document.readyState) checks.push(function(){
return (state == 'loaded' || state == 'complete');
});

if ('onreadystatechange' in document) document.addListener('readystatechange', check);
if ('onreadystatechange' in document){
document.addListener('readystatechange', check);
var state = document.readyState;
if (state == 'loaded' || state == 'complete') domready();
}
else shouldPoll = true;

if (shouldPoll) poll();
Expand Down

0 comments on commit 0dbb4d5

Please sign in to comment.