Fix #10798. Don't re-bubble trigger()ed events in IE.

Since .trigger() already bubbles the event, we don't have to work around the non-bubbling IE events for that case.
This commit is contained in:
Dave Methvin
2011-11-15 21:06:53 -05:00
parent ca8fc725ac
commit 80797f5805
2 changed files with 29 additions and 8 deletions

View File

@@ -752,8 +752,8 @@ if ( !jQuery.support.submitBubbles ) {
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
if ( form && !form._submit_attached ) {
jQuery.event.add( form, "submit._submit", function( event ) {
// Form was submitted, bubble the event up the tree
if ( this.parentNode ) {
// If form was submitted by the user, bubble the event up the tree
if ( this.parentNode && !event.isTrigger ) {
jQuery.event.simulate( "submit", this.parentNode, event, true );
}
});
@@ -793,7 +793,7 @@ if ( !jQuery.support.changeBubbles ) {
}
});
jQuery.event.add( this, "click._change", function( event ) {
if ( this._just_changed ) {
if ( this._just_changed && !event.isTrigger ) {
this._just_changed = false;
jQuery.event.simulate( "change", this, event, true );
}
@@ -807,7 +807,7 @@ if ( !jQuery.support.changeBubbles ) {
if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
jQuery.event.add( elem, "change._change", function( event ) {
if ( this.parentNode && !event.isSimulated ) {
if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
jQuery.event.simulate( "change", this.parentNode, event, true );
}
});