root / trunk / web / dojo / dijit / tree / _dndContainer.js @ 12
History | View | Annotate | Download (1.79 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["dijit.tree._dndContainer"]){ |
||
9 | dojo._hasResource["dijit.tree._dndContainer"]=true; |
||
10 | dojo.provide("dijit.tree._dndContainer");
|
||
11 | dojo.require("dojo.dnd.common");
|
||
12 | dojo.require("dojo.dnd.Container");
|
||
13 | dojo.declare("dijit.tree._dndContainer",null,{constructor:function(_1,_2){ |
||
14 | this.tree=_1;
|
||
15 | this.node=_1.domNode;
|
||
16 | dojo.mixin(this,_2);
|
||
17 | this.map={};
|
||
18 | this.current=null; |
||
19 | this.containerState=""; |
||
20 | dojo.addClass(this.node,"dojoDndContainer"); |
||
21 | this.events=[dojo.connect(this.node,"onmouseenter",this,"onOverEvent"),dojo.connect(this.node,"onmouseleave",this,"onOutEvent"),dojo.connect(this.tree,"_onNodeMouseEnter",this,"onMouseOver"),dojo.connect(this.tree,"_onNodeMouseLeave",this,"onMouseOut"),dojo.connect(this.node,"ondragstart",dojo,"stopEvent"),dojo.connect(this.node,"onselectstart",dojo,"stopEvent")]; |
||
22 | },getItem:function(_3){ |
||
23 | var _4=this.selection[_3],_5={data:dijit.getEnclosingWidget(_4),type:["treeNode"]}; |
||
24 | return _5;
|
||
25 | },destroy:function(){ |
||
26 | dojo.forEach(this.events,dojo.disconnect);
|
||
27 | this.node=this.parent=null; |
||
28 | },onMouseOver:function(_6,_7){ |
||
29 | this.current=_6.rowNode;
|
||
30 | this.currentWidget=_6;
|
||
31 | },onMouseOut:function(_8,_9){ |
||
32 | this.current=null; |
||
33 | this.currentWidget=null; |
||
34 | },_changeState:function(_a,_b){ |
||
35 | var _c="dojoDnd"+_a; |
||
36 | var _d=_a.toLowerCase()+"State"; |
||
37 | dojo.removeClass(this.node,_c+this[_d]); |
||
38 | dojo.addClass(this.node,_c+_b);
|
||
39 | this[_d]=_b;
|
||
40 | },_addItemClass:function(_e,_f){ |
||
41 | dojo.addClass(_e,"dojoDndItem"+_f);
|
||
42 | },_removeItemClass:function(_10,_11){ |
||
43 | dojo.removeClass(_10,"dojoDndItem"+_11);
|
||
44 | },onOverEvent:function(){ |
||
45 | this._changeState("Container","Over"); |
||
46 | },onOutEvent:function(){ |
||
47 | this._changeState("Container",""); |
||
48 | }}); |
||
49 | } |