Added support for map of events in live, die, delegate and undelegate. Fixes #6282.

This commit is contained in:
Robert Katic 2010-03-14 12:34:32 +01:00 committed by jeresig
parent 97b42492bb
commit da5706c974
2 changed files with 47 additions and 0 deletions

View file

@ -944,6 +944,14 @@ jQuery.each(["live", "die"], function( i, name ) {
var type, i = 0, match, namespaces, preType,
selector = origSelector || this.selector,
context = origSelector ? this : jQuery( this.context );
if ( typeof types === "object" && !types.preventDefault ) {
for ( var key in types ) {
context[ name ]( key, data, types[key], selector );
}
return this;
}
if ( jQuery.isFunction( data ) ) {
fn = data;