Make sure that special.add actually copies over event namespaces and data. Fixes #5779 and #5834.

This commit is contained in:
jeresig 2010-01-25 17:01:07 -05:00
parent 0474917c9d
commit 390186b902
2 changed files with 43 additions and 0 deletions

View file

@ -114,6 +114,8 @@ jQuery.event = {
var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers );
if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) {
modifiedHandler.guid = modifiedHandler.guid || handler.guid;
modifiedHandler.data = modifiedHandler.data || handler.data;
modifiedHandler.type = modifiedHandler.type || handler.type;
handler = modifiedHandler;
}
}