1 /** Licensed Materials - Property of IBM, 5724-E76 and 5724-E77, (C) Copyright IBM Corp. 2011, 2012 - All Rights reserved. **/ 2 (function(){ 3 var i$=window.i$; 4 var _1=function(e){ 5 if(!e){ 6 return false; 7 } 8 if(e.preventDefault){ 9 e.preventDefault(); 10 }else{ 11 e.returnValue=false; 12 } 13 },_2={addSource:function(_3){ 14 var n=_3.node; 15 n.setAttribute("draggable","true"); 16 i$.bindDomEvt(n,"dragstart",function(e){ 17 e.dataTransfer.setData(_3.type,_3.data); 18 if(_3.avatar&&e.dataTransfer.setDragImage){ 19 e.dataTransfer.setDragImage(_3.avatar,0,0); 20 } 21 i$.isFunction(_3.dragstart)&&_3.dragstart(e,n); 22 }); 23 i$.isFunction(_3.dragend)&&i$.bindDomEvt(n,"dragend",function(e){ 24 _3.dragend(e,n); 25 }); 26 },addTarget:function(_4){ 27 var n=_4.node; 28 i$.forEach(["dragover","dragenter","dragleave","drop"],function(_5){ 29 i$.bindDomEvt(n,_5,_5==="drop"?function(e){ 30 var _6=_4.drop(e,n,_4.type,e.dataTransfer.getData(_4.type)); 31 _1(e); 32 return !!_6; 33 }:function(e){ 34 i$.isFunction(_4[_5])&&_4[_5](e,n); 35 _1(e); 36 }); 37 }); 38 }}; 39 i$.dnd=_2; 40 })(); 41 42