Changeset 12160

Show
Ignore:
Timestamp:
01/24/08 21:05:28 (6 months ago)
Author:
bill
Message:

Fixes #5648:

  • child widget not started after parent.refresh() or setHref() call
  • top level ContentPane? will pass bogus size argument to child.resize() (but works if ContentPane? is child of a layout container)

Also has the start of some code to control when ContentPane? acts (or doesn't act) as a layout container, sizing it's child widget.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/layout/ContentPane.js

    r11731 r12160  
    7272        // class: String 
    7373        //      Class name to apply to ContentPane dom nodes 
     74        // TODO: this should be called "baseClass" like in the other widgets 
    7475        "class": "dijitContentPane", 
     76 
     77        // layout: String/Boolean 
     78        //      false - don't adjust size of children 
     79        //      true - looks for the first sizable child widget (ie, having resize() method) and sets it's size to 
     80        //                      however big the ContentPane is 
     81        //      auto - if there is a single sizable child widget (ie, having resize() method), set it's size to 
     82        //                      however big the ContentPane is 
     83        doLayout: "auto", 
    7584 
    7685        postCreate: function(){ 
     
    106115                //      Test if we have exactly one widget as a child, and if so assume that we are a container for that widget, 
    107116                //      and should propogate startup() and resize() calls to it. 
     117 
     118                // TODO: if there are two child widgets (a data store and a TabContainer, for example), 
     119                //      should still find the TabContainer 
    108120                var childNodes = dojo.query(">", this.containerNode || this.domNode), 
    109121                        childWidgets = childNodes.filter("[widgetId]"); 
     
    162174                } 
    163175 
    164                 this._checkIfSingleChild(); 
    165                 if(this._singleChild && this._singleChild.resize){ 
    166                         this._singleChild.resize(this._contentBox); 
    167                 } 
     176//              if(this.doLayout != "false" && this.doLayout !== false){ 
     177                        this._checkIfSingleChild(); 
     178                        console.log("singlechild " , this._singleChild, " my content box is ", this._contentBox); 
     179                        if(this._singleChild && this._singleChild.resize){ 
     180                                this._singleChild.startup(); 
     181                                this._singleChild.resize(this._contentBox || dojo.contentBox(this.containerNode || this.domNode)); 
     182                        } 
     183//              } 
    168184 
    169185                this._onLoadHandler();