File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ var jQuery = function( selector, context ) {
4646
4747 // The functions to execute on DOM ready
4848 readyList = [ ] ,
49+
50+ // Counts how many ready holds are active
51+ readyHold = 0 ,
4952
5053 // The ready event handler
5154 DOMContentLoaded ,
@@ -360,9 +363,20 @@ jQuery.extend({
360363 isReady : false ,
361364
362365 // Handle when the DOM is ready
363- ready : function ( ) {
366+ ready : function ( state ) {
364367 // Make sure that the DOM is not already loaded
365368 if ( ! jQuery . isReady ) {
369+ if ( typeof state === "boolean" ) {
370+ // plugin is delaying or undelaying the ready event
371+ if ( state ) {
372+ readyHold -- ;
373+ } else {
374+ readyHold ++ ;
375+ }
376+ }
377+ if ( readyHold > 0 ) {
378+ return ;
379+ }
366380 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
367381 if ( ! document . body ) {
368382 return setTimeout ( jQuery . ready , 13 ) ;
You can’t perform that action at this time.
0 commit comments