Skip to content
Permalink
Browse files

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

… it on IE."

This reverts commit 3d0de29.
  • Loading branch information...
dmethvin authored and timmywil committed Sep 9, 2011
1 parent 8c91da5 commit 4030de9519e91fdc247af3c508a8ede277242c3f
Showing with 7 additions and 8 deletions.
  1. +7 −8 src/event.js
@@ -799,8 +799,8 @@ if ( !jQuery.support.changeBubbles ) {
jQuery._data( elem, "_change_data", val );
}

if ( val !== old && old != null && elem.parentNode ) {
simulate( "change", elem.parentNode, e, true );
if ( val !== old && old != null ) {
simulate( "change", elem, e, true );
}
},

@@ -852,21 +852,20 @@ if ( !jQuery.support.changeBubbles ) {
jQuery.event.special.change = {

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;
}

for ( var type in changeFilters ) {
jQuery.event.add( this, type + "._change", changeFilters[ type ] );
}

return rformElems.test( this.nodeName );
},

teardown: function( namespaces ) {
if ( rformElems.test( this.nodeName ) ) {
return false;
}
jQuery.event.remove( this, "._change" );

return rformElems.test( this.nodeName );
}
};
}

0 comments on commit 4030de9

Please sign in to comment.
You can’t perform that action at this time.