summaryrefslogtreecommitdiff
path: root/lib/dijit/_Container.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-15 10:39:52 +0300
committerAndrew Dolgov <[email protected]>2010-11-15 10:39:52 +0300
commit2f01fe57a8d37767827d6db42850aef86a767c53 (patch)
tree516a95ffce2fc2435aed8d9976e444dbcba7dce3 /lib/dijit/_Container.js
parent951906dcecb1d3c7bcf751976a03e0c196ca6db0 (diff)
add dijit/dojo stuff; initial ui mockup
Diffstat (limited to 'lib/dijit/_Container.js')
-rw-r--r--lib/dijit/_Container.js62
1 files changed, 62 insertions, 0 deletions
diff --git a/lib/dijit/_Container.js b/lib/dijit/_Container.js
new file mode 100644
index 000000000..ce8232cb3
--- /dev/null
+++ b/lib/dijit/_Container.js
@@ -0,0 +1,62 @@
+/*
+ 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._Container"]){
+dojo._hasResource["dijit._Container"]=true;
+dojo.provide("dijit._Container");
+dojo.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){
+this.inherited(arguments);
+if(!this.containerNode){
+this.containerNode=this.domNode;
+}
+},addChild:function(_1,_2){
+var _3=this.containerNode;
+if(_2&&typeof _2=="number"){
+var _4=this.getChildren();
+if(_4&&_4.length>=_2){
+_3=_4[_2-1].domNode;
+_2="after";
+}
+}
+dojo.place(_1.domNode,_3,_2);
+if(this._started&&!_1._started){
+_1.startup();
+}
+},removeChild:function(_5){
+if(typeof _5=="number"&&_5>0){
+_5=this.getChildren()[_5];
+}
+if(_5){
+var _6=_5.domNode;
+if(_6&&_6.parentNode){
+_6.parentNode.removeChild(_6);
+}
+}
+},hasChildren:function(){
+return this.getChildren().length>0;
+},destroyDescendants:function(_7){
+dojo.forEach(this.getChildren(),function(_8){
+_8.destroyRecursive(_7);
+});
+},_getSiblingOfChild:function(_9,_a){
+var _b=_9.domNode,_c=(_a>0?"nextSibling":"previousSibling");
+do{
+_b=_b[_c];
+}while(_b&&(_b.nodeType!=1||!dijit.byNode(_b)));
+return _b&&dijit.byNode(_b);
+},getIndexOfChild:function(_d){
+return dojo.indexOf(this.getChildren(),_d);
+},startup:function(){
+if(this._started){
+return;
+}
+dojo.forEach(this.getChildren(),function(_e){
+_e.startup();
+});
+this.inherited(arguments);
+}});
+}