From 2f01fe57a8d37767827d6db42850aef86a767c53 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Nov 2010 10:39:52 +0300 Subject: add dijit/dojo stuff; initial ui mockup --- lib/dijit/tree/_dndContainer.js | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 lib/dijit/tree/_dndContainer.js (limited to 'lib/dijit/tree/_dndContainer.js') diff --git a/lib/dijit/tree/_dndContainer.js b/lib/dijit/tree/_dndContainer.js new file mode 100644 index 000000000..e925283df --- /dev/null +++ b/lib/dijit/tree/_dndContainer.js @@ -0,0 +1,49 @@ +/* + Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. + Available via Academic Free License >= 2.1 OR the modified BSD license. + see: http://dojotoolkit.org/license for details +*/ + + +if(!dojo._hasResource["dijit.tree._dndContainer"]){ +dojo._hasResource["dijit.tree._dndContainer"]=true; +dojo.provide("dijit.tree._dndContainer"); +dojo.require("dojo.dnd.common"); +dojo.require("dojo.dnd.Container"); +dojo.declare("dijit.tree._dndContainer",null,{constructor:function(_1,_2){ +this.tree=_1; +this.node=_1.domNode; +dojo.mixin(this,_2); +this.map={}; +this.current=null; +this.containerState=""; +dojo.addClass(this.node,"dojoDndContainer"); +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")]; +},getItem:function(_3){ +var _4=this.selection[_3],_5={data:dijit.getEnclosingWidget(_4),type:["treeNode"]}; +return _5; +},destroy:function(){ +dojo.forEach(this.events,dojo.disconnect); +this.node=this.parent=null; +},onMouseOver:function(_6,_7){ +this.current=_6.rowNode; +this.currentWidget=_6; +},onMouseOut:function(_8,_9){ +this.current=null; +this.currentWidget=null; +},_changeState:function(_a,_b){ +var _c="dojoDnd"+_a; +var _d=_a.toLowerCase()+"State"; +dojo.removeClass(this.node,_c+this[_d]); +dojo.addClass(this.node,_c+_b); +this[_d]=_b; +},_addItemClass:function(_e,_f){ +dojo.addClass(_e,"dojoDndItem"+_f); +},_removeItemClass:function(_10,_11){ +dojo.removeClass(_10,"dojoDndItem"+_11); +},onOverEvent:function(){ +this._changeState("Container","Over"); +},onOutEvent:function(){ +this._changeState("Container",""); +}}); +} -- cgit v1.2.3