root / trunk / web / dojo / dojox / mdnd / DropIndicator.js @ 12
History | View | Annotate | Download (1.18 KB)
1 |
/*
|
---|---|
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.mdnd.DropIndicator"]){ |
9 |
dojo._hasResource["dojox.mdnd.DropIndicator"]=true; |
10 |
dojo.provide("dojox.mdnd.DropIndicator");
|
11 |
dojo.require("dojox.mdnd.AreaManager");
|
12 |
dojo.declare("dojox.mdnd.DropIndicator",null,{node:null,constructor:function(){ |
13 |
var _1=document.createElement("div"); |
14 |
var _2=document.createElement("div"); |
15 |
_1.appendChild(_2); |
16 |
dojo.addClass(_1,"dropIndicator");
|
17 |
this.node=_1;
|
18 |
},place:function(_3,_4,_5){ |
19 |
if(_5){
|
20 |
this.node.style.height=_5.h+"px"; |
21 |
} |
22 |
try{
|
23 |
if(_4){
|
24 |
_3.insertBefore(this.node,_4);
|
25 |
}else{
|
26 |
_3.appendChild(this.node);
|
27 |
} |
28 |
return this.node; |
29 |
} |
30 |
catch(e){
|
31 |
return null; |
32 |
} |
33 |
},remove:function(){ |
34 |
if(this.node){ |
35 |
this.node.style.height=""; |
36 |
if(this.node.parentNode){ |
37 |
this.node.parentNode.removeChild(this.node); |
38 |
} |
39 |
} |
40 |
},destroy:function(){ |
41 |
if(this.node){ |
42 |
if(this.node.parentNode){ |
43 |
this.node.parentNode.removeChild(this.node); |
44 |
} |
45 |
dojo._destroyElement(this.node);
|
46 |
delete this.node; |
47 |
} |
48 |
}}); |
49 |
(function(){
|
50 |
dojox.mdnd.areaManager()._dropIndicator=new dojox.mdnd.DropIndicator();
|
51 |
}()); |
52 |
} |