Skip to content

Commit

Permalink
Updated ContentLoaded() to use internal event binding funcs.
Browse files Browse the repository at this point in the history
Removed unused vars and standardised string quotes.
Tidy changelog.txt
  • Loading branch information
keithclark committed Apr 23, 2011
1 parent 3ddd014 commit 994f657
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
13 changes: 8 additions & 5 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ selectivizr - change log
========================


current build
-------------
v1.0.2
------

* NEW - Removed the eval() from determineSelectorMethod() - YAY!
* BUG - selectivizr incorrectly detects Yahoo! profiler as YUI seletor library
* BUG - fixed Google Closure Compiler issue that added 2 global vars - sorry about that!
* NEW - removed the eval() from determineSelectorMethod()
* BUG - selectivizr incorrectly detects Yahoo! profiler as YUI selector library
* NEW - selectivizr can now be "lazy-loaded"
* NEW - Switched DOMReady back to Diego Perini's (new) ContentLoaded.
* NEW - switched DOMReady back to Diego Perini's (new) ContentLoaded.
* BUG - asset urls using the 'data:' scheme (i.e. background-image) resolved to a path (Chris Korhonen)
* BUG - resolveUrl() failed if the context url contained a hash followed by a '/' (Zee Agency)
* BUG - IE version detection wasn't IE>9 friendly (reported by Paul Irish)



v1.0.1
------

Expand All @@ -22,6 +24,7 @@ v1.0.1
* BUG - patched [*=""] selector in IE8 (returns elements it shouldn't)



v1.0.0
------

Expand Down
16 changes: 6 additions & 10 deletions selectivizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ References:
var ie6PatchID = 0; // used to solve ie6's multiple class bug
var patchIE6MultipleClasses = true; // if true adds class bloat to ie6
var namespace = "slvzr";
var domReadyScriptID = namespace + "DOMReady";

// Stylesheet parsing regexp's
var RE_COMMENT = /(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*/g;
Expand Down Expand Up @@ -539,27 +538,24 @@ References:
function ContentLoaded(win, fn) {

var done = false, top = true,
doc = win.document, root = doc.documentElement,

init = function(e) {
if (e.type == 'readystatechange' && doc.readyState != 'complete') return;
(e.type == 'load' ? win : doc).detachEvent("on" + e.type, init, false);
if (e.type == "readystatechange" && doc.readyState != "complete") return;
(e.type == "load" ? win : doc).detachEvent("on" + e.type, init, false);
if (!done && (done = true)) fn.call(win, e.type || e);
},

poll = function() {
try { root.doScroll('left'); } catch(e) { setTimeout(poll, 50); return; }
try { root.doScroll("left"); } catch(e) { setTimeout(poll, 50); return; }
init('poll');
};

if (doc.readyState == 'complete') fn.call(win, '');
if (doc.readyState == "complete") fn.call(win, EMPTY_STRING);
else {
if (doc.createEventObject && root.doScroll) {
try { top = !win.frameElement; } catch(e) { }
if (top) poll();
}
doc.attachEvent('onreadystatechange', init, false);
win.attachEvent('onload', init, false);
addEvent(doc,"readystatechange", init);
addEvent(win,"load", init);
}
};
})(this);

0 comments on commit 994f657

Please sign in to comment.