Use $.queueTask in $.ready.

This commit is contained in:
Nicolas Stepien 2012-08-27 03:07:18 +02:00
parent f57ef16bb7
commit 320ae65b36
2 changed files with 2 additions and 9 deletions

View File

@ -313,11 +313,7 @@
ready: function(fc) { ready: function(fc) {
var cb; var cb;
if (/interactive|complete/.test(d.readyState)) { if (/interactive|complete/.test(d.readyState)) {
try { $.queueTask(fc);
fc();
} finally {
return;
}
} }
cb = function() { cb = function() {
$.off(d, 'DOMContentLoaded', cb); $.off(d, 'DOMContentLoaded', cb);

View File

@ -263,10 +263,7 @@ $.extend $,
d.getElementById id d.getElementById id
ready: (fc) -> ready: (fc) ->
if /interactive|complete/.test d.readyState if /interactive|complete/.test d.readyState
try $.queueTask fc
fc()
finally
return
cb = -> cb = ->
$.off d, 'DOMContentLoaded', cb $.off d, 'DOMContentLoaded', cb
fc() fc()