Skip to content

Commit

Permalink
Fix DOMContentLoaded with async tag
Browse files Browse the repository at this point in the history
  • Loading branch information
craigfrancis committed Mar 22, 2016
1 parent 9a735a3 commit 316dee5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions additional/height-animation/toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@

}

if (document.readyState === 'complete') {
console.log('ready');
if (document.readyState !== 'loading') {
console.log('a');
window.setTimeout(init); // Handle asynchronously
} else {
console.log('normal');
console.log('b');
document.addEventListener('DOMContentLoaded', init);
}

Expand Down
2 changes: 1 addition & 1 deletion example/size-cross-origin-child.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

}

if (document.readyState === 'complete') {
if (document.readyState !== 'loading') {
window.setTimeout(init); // Handle asynchronously
} else {
document.addEventListener('DOMContentLoaded', init);
Expand Down

0 comments on commit 316dee5

Please sign in to comment.