49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
/**
|
|
* jQuery EasyUI 1.2.5
|
|
*
|
|
* Licensed under the GPL terms
|
|
* To use it on other terms please contact us
|
|
*
|
|
* Copyright(c) 2009-2011 stworthy [ stworthy@gmail.com ]
|
|
*
|
|
*/
|
|
(function($){
|
|
function _1(_2){
|
|
$(_2).addClass("droppable");
|
|
$(_2).bind("_dragenter",function(e,_3){
|
|
$.data(_2,"droppable").options.onDragEnter.apply(_2,[e,_3]);
|
|
});
|
|
$(_2).bind("_dragleave",function(e,_4){
|
|
$.data(_2,"droppable").options.onDragLeave.apply(_2,[e,_4]);
|
|
});
|
|
$(_2).bind("_dragover",function(e,_5){
|
|
$.data(_2,"droppable").options.onDragOver.apply(_2,[e,_5]);
|
|
});
|
|
$(_2).bind("_drop",function(e,_6){
|
|
$.data(_2,"droppable").options.onDrop.apply(_2,[e,_6]);
|
|
});
|
|
};
|
|
$.fn.droppable=function(_7,_8){
|
|
if(typeof _7=="string"){
|
|
return $.fn.droppable.methods[_7](this,_8);
|
|
}
|
|
_7=_7||{};
|
|
return this.each(function(){
|
|
var _9=$.data(this,"droppable");
|
|
if(_9){
|
|
$.extend(_9.options,_7);
|
|
}else{
|
|
_1(this);
|
|
$.data(this,"droppable",{options:$.extend({},$.fn.droppable.defaults,_7)});
|
|
}
|
|
});
|
|
};
|
|
$.fn.droppable.methods={};
|
|
$.fn.droppable.defaults={accept:null,onDragEnter:function(e,_a){
|
|
},onDragOver:function(e,_b){
|
|
},onDragLeave:function(e,_c){
|
|
},onDrop:function(e,_d){
|
|
}};
|
|
})(jQuery);
|
|
|