Commit 4030de95 authored by Dave Methvin's avatar Dave Methvin Committed by timmywil

Update "Fix #6593. Don't trigger `change` event twice when simulating it on IE."

This reverts commit 3d0de29d5615c1b1d74c72e6272484961a4ba243.
parent 8c91da57
...@@ -799,8 +799,8 @@ if ( !jQuery.support.changeBubbles ) { ...@@ -799,8 +799,8 @@ if ( !jQuery.support.changeBubbles ) {
jQuery._data( elem, "_change_data", val ); jQuery._data( elem, "_change_data", val );
} }
if ( val !== old && old != null && elem.parentNode ) { if ( val !== old && old != null ) {
simulate( "change", elem.parentNode, e, true ); simulate( "change", elem, e, true );
} }
}, },
...@@ -852,21 +852,20 @@ if ( !jQuery.support.changeBubbles ) { ...@@ -852,21 +852,20 @@ if ( !jQuery.support.changeBubbles ) {
jQuery.event.special.change = { jQuery.event.special.change = {
setup: function( data, namespaces ) { setup: function( data, namespaces ) {
if ( this.type === "file" ) { // If this is a real input element, no need to fake change
if ( rformElems.test( this.nodeName ) ) {
return false; return false;
} }
for ( var type in changeFilters ) { for ( var type in changeFilters ) {
jQuery.event.add( this, type + "._change", changeFilters[ type ] ); jQuery.event.add( this, type + "._change", changeFilters[ type ] );
} }
return rformElems.test( this.nodeName );
}, },
teardown: function( namespaces ) { teardown: function( namespaces ) {
if ( rformElems.test( this.nodeName ) ) {
return false;
}
jQuery.event.remove( this, "._change" ); jQuery.event.remove( this, "._change" );
return rformElems.test( this.nodeName );
} }
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment