Permalink
Browse files

Updated references to `document` with cached variable `doc`.

  • Loading branch information...
1 parent 7c74766 commit c119d543fa05a05657219d610608572cd5d855a9 @Integralist committed Apr 26, 2011
Showing with 6 additions and 6 deletions.
  1. +6 −6 Assets/Scripts/DOMready.js
View
@@ -13,7 +13,7 @@ var DOMready = (function() {
isIE = (function() {
var undef,
v = 3,
- div = document.createElement('div'),
+ div = doc.createElement('div'),
all = div.getElementsByTagName('i');
while (
@@ -30,8 +30,8 @@ var DOMready = (function() {
loaded = true;
// Cleanup
- if (document.addEventListener) {
- document.removeEventListener("DOMContentLoaded", process, false);
+ if (doc.addEventListener) {
+ doc.removeEventListener("DOMContentLoaded", process, false);
}
// Move the zero index item from the queue and set 'exec' equal to it
@@ -47,18 +47,18 @@ var DOMready = (function() {
return fn();
}
- if (document.addEventListener) {
+ if (doc.addEventListener) {
// Any number of listeners can be set for when this event fires,
// but just know that this event only ever fires once
- document.addEventListener("DOMContentLoaded", process, false);
+ doc.addEventListener("DOMContentLoaded", process, false);
}
// Internet Explorer versions less than 9 don't support DOMContentLoaded.
// The doScroll('left') method by Diego Perini (http://javascript.nwbox.com/IEContentLoaded/) appears to be the most reliable solution.
// Microsoft documentation explains the reasoning behind this http://msdn.microsoft.com/en-us/library/ms531426.aspx#Component_Initialization
else if (isIE < 9) {
explorerTimer = win.setInterval(function() {
- if (document.body) {
+ if (doc.body) {
try {
dce.('div').doScroll('left');
win.clearInterval(explorerTimer);

0 comments on commit c119d54

Please sign in to comment.