Explicitly re-bind the events on clone. Copying over the data isn't enough. Fixes #5681.
This commit is contained in:
parent
1ea539b4f0
commit
7d0c18034e
1 changed files with 12 additions and 1 deletions
|
@ -283,7 +283,18 @@ function cloneCopyEvent(orig, ret) {
|
|||
return;
|
||||
}
|
||||
|
||||
jQuery.data( this, jQuery.data( orig[i++] ) );
|
||||
var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData.events;
|
||||
|
||||
if ( events ) {
|
||||
delete curData.handle;
|
||||
curData.events = {};
|
||||
|
||||
for ( var type in events ) {
|
||||
for ( var handler in events[ type ] ) {
|
||||
jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue