Permalink
Browse files

IE might make me grumpy, but bgerrissen helped me fix bugs in my Prot…

…otype-derived loading code. Closes #1.
  • Loading branch information...
Alex Young
Alex Young committed Mar 7, 2010
1 parent 7aa5e72 commit 736733df472f09e922849b6e5dc7faf78fe3af00
Showing with 4 additions and 4 deletions.
  1. +4 −4 riot.js
View
@@ -52,15 +52,15 @@
function checkReadyState() {
if (document.readyState === 'complete') {
- document.stopObserving('readystatechange', checkReadyState);
+ document.detachEvent('readystatechange', checkReadyState);
fireContentLoadedEvent();
}
}
function pollDoScroll() {
try { document.documentElement.doScroll('left'); }
catch(e) {
- timer = pollDoScroll.defer();
+ timer = setTimeout(pollDoScroll, 10);
return;
}
fireContentLoadedEvent();
@@ -69,9 +69,9 @@
if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false);
} else {
- document.observe('readystatechange', checkReadyState);
+ document.attachEvent('readystatechange', checkReadyState);
if (window == top)
- timer = pollDoScroll.defer();
+ timer = setTimeout(pollDoScroll, 10);
}
window.onload = fireContentLoadedEvent;

0 comments on commit 736733d

Please sign in to comment.