Added support for .unbind(".test") to unbind all namespaced events on an element.

This commit is contained in:
John Resig 2008-02-03 04:33:11 +00:00
parent 77da94552e
commit 703e89ba30
2 changed files with 12 additions and 2 deletions

View file

@ -109,9 +109,9 @@ jQuery.event = {
if ( events ) {
// Unbind all events for the element
if ( types == undefined )
if ( types == undefined || types[0] == "." )
for ( var type in events )
this.remove( elem, type );
this.remove( elem, type + (types || "") );
else {
// types is actually an event object here
if ( types.type ) {