Fix #11925, Pass eventHandle to special.teardown. Closes gh-831.

* Added unit test to confirm.
  The third assertion fails without the fix in ./src/event.js
This commit is contained in:
Timo Tijhof
2012-06-18 04:42:24 +02:00
committed by Dave Methvin
parent d2b0c60840
commit 9bb3494ce9
2 changed files with 16 additions and 1 deletions

View File

@@ -181,7 +181,7 @@ jQuery.event = {
// Remove generic event handler if we removed something and no more handlers exist
// (avoids potential for endless recursion during removal of special event handlers)
if ( eventType.length === 0 && origCount !== eventType.length ) {
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}