root/galaxy-central/static/scripts/packed/jquery.event.drag.js @ 2

リビジョン 2, 2.0 KB (コミッタ: hatakeyama, 14 年 前)

import galaxy-central

行番号 
1/*
2jquery.event.drag.js ~ v1.4 ~ Copyright (c) 2008, Three Dub Media (http://threedubmedia.com) 
3Liscensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-LICENSE.txt
4*/
5(function(h){h.fn.drag=function(k,j,i){if(j){this.bind("dragstart",k)}if(i){this.bind("dragend",i)}return !k?this.trigger("drag"):this.bind("drag",j?j:k)};var d=h.event,b=d.special,f=b.drag={not:":input",distance:0,which:1,setup:function(i){i=h.extend({distance:f.distance,which:f.which,not:f.not},i||{});i.distance=g(i.distance);d.add(this,"mousedown",e,i)},teardown:function(){d.remove(this,"mousedown",e);if(this===f.dragging){f.dragging=f.proxy=null}c(this,true)}};function e(k){var j=this,i,l=k.data||{};if(l.elem){j=k.dragTarget=l.elem;k.dragProxy=f.proxy||j;k.cursorOffsetX=l.pageX-l.left;k.cursorOffsetY=l.pageY-l.top;k.offsetX=k.pageX-k.cursorOffsetX;k.offsetY=k.pageY-k.cursorOffsetY}else{if(f.dragging||(l.which>0&&k.which!=l.which)||h(k.target).is(l.not)){return}}switch(k.type){case"mousedown":h.extend(l,h(j).offset(),{elem:j,target:k.target,pageX:k.pageX,pageY:k.pageY});d.add(document,"mousemove mouseup",e,l);c(j,false);return false;case !f.dragging&&"mousemove":if(g(k.pageX-l.pageX)+g(k.pageY-l.pageY)<l.distance){break}k.target=l.target;i=a(k,"dragstart",j);if(i!==false){f.dragging=j;f.proxy=k.dragProxy=h(i||j)[0]}case"mousemove":if(f.dragging){i=a(k,"drag",j);if(b.drop){b.drop.allowed=(i!==false);b.drop.handler(k)}if(i!==false){break}k.type="mouseup"}case"mouseup":d.remove(document,"mousemove mouseup",e);if(f.dragging){if(b.drop){b.drop.handler(k)}a(k,"dragend",j)}else{a(k,"dragclickonly",j)}c(j,true);f.dragging=f.proxy=l.elem=null;break}}function a(l,j,k){l.type=j;var i=d.handle.call(k,l);return i===false?false:i||l.result}function g(i){return Math.pow(i,2)}function c(j,i){if(!j){return}j.unselectable=i?"off":"on";j.onselectstart=function(){return i};if(document.selection&&document.selection.empty){document.selection.empty()}if(j.style){j.style.MozUserSelect=i?"":"none"}}})(jQuery);
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。