diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2012-05-12 13:38:33 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-05-12 14:23:50 -0400 |
commit | b6581df5de2083e322dcbede4dce74bacf93af5f (patch) | |
tree | cdb57749ed1bd8aeb3a6717145eae5369061bd48 /src/event.js | |
parent | 7799f21307c3e7c16c1b99b79b8f9f93f969b440 (diff) | |
download | jquery-b6581df5de2083e322dcbede4dce74bacf93af5f.tar.gz jquery-b6581df5de2083e322dcbede4dce74bacf93af5f.zip |
Fix #11621, $(document).trigger() must bubble to window.
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/event.js b/src/event.js index 46036c5cf..6351d0b53 100644 --- a/src/event.js +++ b/src/event.js @@ -315,14 +315,13 @@ jQuery.event = { bubbleType = special.delegateType || type; cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; - old = null; - for ( ; cur; cur = cur.parentNode ) { + for ( old = elem; cur; cur = cur.parentNode ) { eventPath.push([ cur, bubbleType ]); old = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( old && old === elem.ownerDocument ) { + if ( old === (elem.ownerDocument || document) ) { eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); } } @@ -782,7 +781,7 @@ if ( !jQuery.support.submitBubbles ) { }); // return undefined since we don't need an event listener }, - + postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { |