mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Fix #11076. If .clone() won't delegate, we must remediate.
Since `jQuery.event.add` can accept a handleObj there's no need to reiterate them as args, but we *do* need to set the `selector` variable correctly.
This commit is contained in:
@@ -50,6 +50,7 @@ jQuery.event = {
|
||||
if ( handler.handler ) {
|
||||
handleObjIn = handler;
|
||||
handler = handleObjIn.handler;
|
||||
selector = handleObjIn.selector;
|
||||
}
|
||||
|
||||
// Make sure that the handler has a unique ID, used to find/remove it later
|
||||
|
||||
@@ -394,7 +394,7 @@ function cloneCopyEvent( src, dest ) {
|
||||
|
||||
for ( type in events ) {
|
||||
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
|
||||
jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
|
||||
jQuery.event.add( dest, type, events[ type ][ i ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user