Changeset 13740

Show
Ignore:
Timestamp:
05/15/08 10:43:28 (2 months ago)
Author:
bill
Message:

Fix bug w/doLayout=true mode where it would effectively double the ContentPane?'s padding, but setting a style="left: 5px; top: 5px;" on the child even though it isn't position:absolute.

Refs #6438. !strict

Files:
1 modified

Legend:

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

    r13521 r13740  
    193193                        if(this._singleChild && this._singleChild.resize){ 
    194194                                this._singleChild.startup(); 
    195                                 this._singleChild.resize(this._contentBox || dojo.contentBox(this.containerNode)); 
     195                                var cb = this._contentBox || dojo.contentBox(this.containerNode); 
     196                                this._singleChild.resize({w: cb.w, h: cb.h}); 
    196197                        } 
    197198                } 
     
    230231                        mb = dojo.mixin(dojo.marginBox(node), size||{}); 
    231232 
    232                 this._contentBox = dijit.layout.marginBox2contentBox(node, mb); 
     233                var cb = this._contentBox = dijit.layout.marginBox2contentBox(node, mb); 
    233234 
    234235                // If we have a single widget child then size it to fit snugly within my borders 
    235236                if(this._singleChild && this._singleChild.resize){ 
    236                         this._singleChild.resize(this._contentBox); 
     237                        // note: if widget has padding this._contentBox will have l and t set, 
     238                        // but don't pass them to resize() or it will doubly-offset the child 
     239                        this._singleChild.resize({w: cb.w, h: cb.h}); 
    237240                } 
    238241        },