MCPcopy Create free account
hub / github.com/TruthHun/BookStack / cloneCopyEvent

Function cloneCopyEvent

static/jquery/1.12.4/jquery.js:5914–5939  ·  view source on GitHub ↗
( src, dest )

Source from the content-addressed store, hash-verified

5912}
5913
5914function cloneCopyEvent( src, dest ) {
5915 if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
5916 return;
5917 }
5918
5919 var type, i, l,
5920 oldData = jQuery._data( src ),
5921 curData = jQuery._data( dest, oldData ),
5922 events = oldData.events;
5923
5924 if ( events ) {
5925 delete curData.handle;
5926 curData.events = {};
5927
5928 for ( type in events ) {
5929 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5930 jQuery.event.add( dest, type, events[ type ][ i ] );
5931 }
5932 }
5933 }
5934
5935 // make the cloned public data object a copy from the original
5936 if ( curData.data ) {
5937 curData.data = jQuery.extend( {}, curData.data );
5938 }
5939}
5940
5941function fixCloneNodeIssues( src, dest ) {
5942 var nodeName, e, data;

Callers 1

jquery.jsFile · 0.70

Calls 1

extendMethod · 0.80

Tested by

no test coverage detected