root / trunk / web / dojo / dojox / grid / enhanced / dnd / _DndMover.js
History | View | Annotate | Download (1.05 KB)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
4 | see: http://dojotoolkit.org/license for details
|
||
5 | */
|
||
6 | |||
7 | |||
8 | if(!dojo._hasResource["dojox.grid.enhanced.dnd._DndMover"]){ |
||
9 | dojo._hasResource["dojox.grid.enhanced.dnd._DndMover"]=true; |
||
10 | dojo.provide("dojox.grid.enhanced.dnd._DndMover");
|
||
11 | dojo.require("dojo.dnd.move");
|
||
12 | dojo.declare("dojox.grid.enhanced.dnd._DndMover",dojo.dnd.Mover,{onMouseMove:function(e){ |
||
13 | dojo.dnd.autoScroll(e); |
||
14 | var m=this.marginBox; |
||
15 | this.host.onMove(this,{l:m.l+e.pageX,t:m.t+e.pageY},{x:e.pageX,y:e.pageY}); |
||
16 | dojo.stopEvent(e); |
||
17 | }}); |
||
18 | dojo.declare("dojox.grid.enhanced.dnd._DndBoxConstrainedMoveable",dojo.dnd.move.boxConstrainedMoveable,{movingType:"row",constructor:function(_1,_2){ |
||
19 | if(!_2||!_2.movingType){
|
||
20 | return;
|
||
21 | } |
||
22 | this.movingType=_2.movingType;
|
||
23 | },onFirstMove:function(_3){ |
||
24 | this.inherited(arguments); |
||
25 | if(this.within){ |
||
26 | var c=this.constraintBox,mb=dojo.marginBox(_3.node); |
||
27 | if(this.movingType=="row"){ |
||
28 | c.r+=mb.w; |
||
29 | }else{
|
||
30 | if(this.movingType=="col"){ |
||
31 | c.b+=mb.h; |
||
32 | } |
||
33 | } |
||
34 | } |
||
35 | }}); |
||
36 | } |