/** * EasyUI for jQuery 1.10.16 * * Copyright (c) 2009-2023 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(e){ var _2=$.data(e.data.target,"draggable"); var _3=_2.options; var _4=_2.proxy; var _5=e.data; var _6=_5.startLeft+e.pageX-_5.startX; var _7=_5.startTop+e.pageY-_5.startY; if(_4){ if(_4.parent()[0]==document.body){ if(_3.deltaX!=null&&_3.deltaX!=undefined){ _6=e.pageX+_3.deltaX; }else{ _6=e.pageX-e.data.offsetWidth; } if(_3.deltaY!=null&&_3.deltaY!=undefined){ _7=e.pageY+_3.deltaY; }else{ _7=e.pageY-e.data.offsetHeight; } }else{ if(_3.deltaX!=null&&_3.deltaX!=undefined){ _6+=e.data.offsetWidth+_3.deltaX; } if(_3.deltaY!=null&&_3.deltaY!=undefined){ _7+=e.data.offsetHeight+_3.deltaY; } } } if(e.data.parent!=document.body){ _6+=$(e.data.parent).scrollLeft(); _7+=$(e.data.parent).scrollTop(); } if(_3.axis=="h"){ _5.left=_6; }else{ if(_3.axis=="v"){ _5.top=_7; }else{ _5.left=_6; _5.top=_7; } } }; function _8(e){ var _9=$.data(e.data.target,"draggable"); var _a=_9.options; var _b=_9.proxy; if(!_b){ _b=$(e.data.target); } _b.css({left:e.data.left,top:e.data.top}); $("body").css("cursor",_a.cursor); }; function _c(e){ if(!$.fn.draggable.isDragging){ return false; } var _d=$.data(e.data.target,"draggable"); var _e=_d.options; var _f=$(".droppable:visible").filter(function(){ return e.data.target!=this; }).filter(function(){ var _10=$.data(this,"droppable").options.accept; if(_10){ return $(_10).filter(function(){ return this==e.data.target; }).length>0; }else{ return true; } }); _d.droppables=_f; var _11=_d.proxy; if(!_11){ if(_e.proxy){ if(_e.proxy=="clone"){ _11=$(e.data.target).clone().insertAfter(e.data.target); }else{ _11=_e.proxy.call(e.data.target,e.data.target); } _d.proxy=_11; }else{ _11=$(e.data.target); } } _11.css("position","absolute"); _1(e); _8(e); _e.onStartDrag.call(e.data.target,e); return false; }; function _12(e){ if(!$.fn.draggable.isDragging){ return false; } var _13=$.data(e.data.target,"draggable"); _1(e); if(_13.options.onDrag.call(e.data.target,e)!=false){ _8(e); } var _14=e.data.target; _13.droppables.each(function(){ var _15=$(this); if(_15.droppable("options").disabled){ return; } var p2=_15.offset(); if(e.pageX>p2.left&&e.pageXp2.top&&e.pageYp2.left&&e.pageXp2.top&&e.pageY_2b.options.edge; }; }); }; $.fn.draggable.methods={options:function(jq){ return $.data(jq[0],"draggable").options; },proxy:function(jq){ return $.data(jq[0],"draggable").proxy; },enable:function(jq){ return jq.each(function(){ $(this).draggable({disabled:false}); }); },disable:function(jq){ return jq.each(function(){ $(this).draggable({disabled:true}); }); }}; $.fn.draggable.parseOptions=function(_30){ var t=$(_30); return $.extend({},$.parser.parseOptions(_30,["cursor","handle","axis",{"revert":"boolean","deltaX":"number","deltaY":"number","edge":"number","delay":"number"}]),{disabled:(t.attr("disabled")?true:undefined)}); }; $.fn.draggable.defaults={proxy:null,revert:false,cursor:"move",deltaX:null,deltaY:null,handle:null,disabled:false,edge:0,axis:null,delay:100,onBeforeDrag:function(e){ },onStartDrag:function(e){ },onDrag:function(e){ },onEndDrag:function(e){ },onStopDrag:function(e){ }}; $.fn.draggable.isDragging=false; })(jQuery);