123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- 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(/*dijit._Widget*/ widget, /*int?*/ insertIndex){
-
-
-
-
-
- var refNode = this.containerNode;
- if(insertIndex && typeof insertIndex == "number"){
- var children = this.getChildren();
- if(children && children.length >= insertIndex){
- refNode = children[insertIndex-1].domNode;
- insertIndex = "after";
- }
- }
- dojo.place(widget.domNode, refNode, insertIndex);
-
-
-
-
- if(this._started && !widget._started){
- widget.startup();
- }
- },
- removeChild: function(/*Widget or int*/ widget){
-
-
-
-
- if(typeof widget == "number"){
- widget = this.getChildren()[widget];
- }
- if(widget){
- var node = widget.domNode;
- if(node && node.parentNode){
- node.parentNode.removeChild(node);
- }
- }
- },
- hasChildren: function(){
-
-
- return this.getChildren().length > 0;
- },
- destroyDescendants: function(/*Boolean*/ preserveDom){
-
-
-
- dojo.forEach(this.getChildren(), function(child){ child.destroyRecursive(preserveDom); });
- },
- _getSiblingOfChild: function(/*dijit._Widget*/ child, /*int*/ dir){
-
-
-
-
-
-
-
- var node = child.domNode,
- which = (dir>0 ? "nextSibling" : "previousSibling");
- do{
- node = node[which];
- }while(node && (node.nodeType != 1 || !dijit.byNode(node)));
- return node && dijit.byNode(node);
- },
- getIndexOfChild: function(/*dijit._Widget*/ child){
-
-
- return dojo.indexOf(this.getChildren(), child);
- },
- startup: function(){
-
-
-
-
-
-
-
-
-
-
- if(this._started){ return; }
-
- dojo.forEach(this.getChildren(), function(child){ child.startup(); });
- this.inherited(arguments);
- }
- }
- );
- }
|