Animal
22 Apr 2009, 5:55 AM
FitLayout has
onLayout : function(ct, target){
Ext.layout.FitLayout.superclass.onLayout.call(this, ct, target);
if(!this.container.collapsed){
var sz = (Ext.isIE6 && Ext.isStrict && target.dom == document.body) ? target.getViewSize() : target.getStyleSize();
this.setItemSize(this.activeItem || ct.items.itemAt(0), sz);
}
},
AnchorLayout has
getAnchorViewSize : function(ct, target){
return target.dom == document.body ?
target.getViewSize() : target.getStyleSize();
},
ColumnLayout has
onLayout : function(ct, target){
var cs = ct.items.items, len = cs.length, c, i;
if(!this.innerCt){
target.addClass('x-column-layout-ct');
// the innerCt prevents wrapping and shuffling while
// the container is resizing
this.innerCt = target.createChild({cls:'x-column-inner'});
this.innerCt.createChild({cls:'x-clear'});
}
this.renderAll(ct, this.innerCt);
var size = Ext.isIE && target.dom != Ext.getBody().dom ? target.getStyleSize() : target.getViewSize();
...
BorderLayout has
onLayout : function(ct, target){
var collapsed;
if(!this.rendered){
target.addClass('x-border-layout-ct');
var items = ct.items.items;
collapsed = [];
for(var i = 0, len = items.length; i < len; i++) {
var c = items[i];
var pos = c.region;
if(c.collapsed){
collapsed.push(c);
}
c.collapsed = false;
if(!c.rendered){
c.cls = c.cls ? c.cls +' x-border-panel' : 'x-border-panel';
c.render(target, i);
}
this[pos] = pos != 'center' && c.split ?
new Ext.layout.BorderLayout.SplitRegion(this, c.initialConfig, pos) :
new Ext.layout.BorderLayout.Region(this, c.initialConfig, pos);
this[pos].render(target, c);
}
this.rendered = true;
}
var size = target.getViewSize();
...
BoxLayout has
getTargetSize : function(target){
return (Ext.isIE6 && Ext.isStrict && target.dom == document.body) ? target.getStyleSize() : target.getViewSize();
//return Ext.isIE && target.dom != Ext.getBody().dom ? target.getStyleSize() : target.getViewSize();
}
There should be one method to do this in ContainerLayout.
And I'm still not convinced Element.getStyleSize accounts for padding correctly. It only subtracts getFrameWidth if borderBox. I thought borderBox determines whether the border is counted in size calculations: getFrameWidth only adds padding if borderBox. I think padding should always be added to the frame width if the onlyContentBox. param is passed.
Here's a bug report about that: http://extjs.com/forum/showthread.php?t=65963
onLayout : function(ct, target){
Ext.layout.FitLayout.superclass.onLayout.call(this, ct, target);
if(!this.container.collapsed){
var sz = (Ext.isIE6 && Ext.isStrict && target.dom == document.body) ? target.getViewSize() : target.getStyleSize();
this.setItemSize(this.activeItem || ct.items.itemAt(0), sz);
}
},
AnchorLayout has
getAnchorViewSize : function(ct, target){
return target.dom == document.body ?
target.getViewSize() : target.getStyleSize();
},
ColumnLayout has
onLayout : function(ct, target){
var cs = ct.items.items, len = cs.length, c, i;
if(!this.innerCt){
target.addClass('x-column-layout-ct');
// the innerCt prevents wrapping and shuffling while
// the container is resizing
this.innerCt = target.createChild({cls:'x-column-inner'});
this.innerCt.createChild({cls:'x-clear'});
}
this.renderAll(ct, this.innerCt);
var size = Ext.isIE && target.dom != Ext.getBody().dom ? target.getStyleSize() : target.getViewSize();
...
BorderLayout has
onLayout : function(ct, target){
var collapsed;
if(!this.rendered){
target.addClass('x-border-layout-ct');
var items = ct.items.items;
collapsed = [];
for(var i = 0, len = items.length; i < len; i++) {
var c = items[i];
var pos = c.region;
if(c.collapsed){
collapsed.push(c);
}
c.collapsed = false;
if(!c.rendered){
c.cls = c.cls ? c.cls +' x-border-panel' : 'x-border-panel';
c.render(target, i);
}
this[pos] = pos != 'center' && c.split ?
new Ext.layout.BorderLayout.SplitRegion(this, c.initialConfig, pos) :
new Ext.layout.BorderLayout.Region(this, c.initialConfig, pos);
this[pos].render(target, c);
}
this.rendered = true;
}
var size = target.getViewSize();
...
BoxLayout has
getTargetSize : function(target){
return (Ext.isIE6 && Ext.isStrict && target.dom == document.body) ? target.getStyleSize() : target.getViewSize();
//return Ext.isIE && target.dom != Ext.getBody().dom ? target.getStyleSize() : target.getViewSize();
}
There should be one method to do this in ContainerLayout.
And I'm still not convinced Element.getStyleSize accounts for padding correctly. It only subtracts getFrameWidth if borderBox. I thought borderBox determines whether the border is counted in size calculations: getFrameWidth only adds padding if borderBox. I think padding should always be added to the frame width if the onlyContentBox. param is passed.
Here's a bug report about that: http://extjs.com/forum/showthread.php?t=65963