aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2011-09-08 23:31:47 -0400
committertimmywil <timmywillisn@gmail.com>2011-09-19 15:42:32 -0400
commit4030de9519e91fdc247af3c508a8ede277242c3f (patch)
treebfd83244b1d2486512809418623de7c61aa16de6
parent8c91da57b9fbc8ded9854a899e4105530cea1d90 (diff)
downloadjquery-4030de9519e91fdc247af3c508a8ede277242c3f.tar.gz
jquery-4030de9519e91fdc247af3c508a8ede277242c3f.zip
Update "Fix #6593. Don't trigger `change` event twice when simulating it on IE."
This reverts commit 3d0de29d5615c1b1d74c72e6272484961a4ba243.
-rw-r--r--src/event.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/event.js b/src/event.js
index 688aa9fb0..ea9882d05 100644
--- a/src/event.js
+++ b/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 );
}
};
}