X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..e9397f91ede62d446aed37d23256e8938fc4c335:/examples/ux/RowLayout.js diff --git a/examples/ux/RowLayout.js b/examples/ux/RowLayout.js index 85ec7648..8de2e2c3 100644 --- a/examples/ux/RowLayout.js +++ b/examples/ux/RowLayout.js @@ -1,8 +1,8 @@ /*! - * Ext JS Library 3.1.1 - * Copyright(c) 2006-2010 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ // We are adding these custom layouts to a namespace that does not // exist by default in Ext, so we have to add the namespace first: @@ -87,6 +87,14 @@ Ext.ux.layout.RowLayout = Ext.extend(Ext.layout.ContainerLayout, { var target = this.container.getLayoutTarget(), ret; if (target) { ret = target.getViewSize(); + + // IE in strict mode will return a height of 0 on the 1st pass of getViewSize. + // Use getStyleSize to verify the 0 height, the adjustment pass will then work properly + // with getViewSize + if (Ext.isIE && Ext.isStrict && ret.height == 0){ + ret = target.getStyleSize(); + } + ret.width -= target.getPadding('lr'); ret.height -= target.getPadding('tb'); } @@ -105,7 +113,12 @@ Ext.ux.layout.RowLayout = Ext.extend(Ext.layout.ContainerLayout, { // private onLayout : function(ct, target){ - var rs = ct.items.items, len = rs.length, r, i; + var rs = ct.items.items, + len = rs.length, + r, + m, + i, + margins = []; this.renderAll(ct, target); @@ -125,8 +138,10 @@ Ext.ux.layout.RowLayout = Ext.extend(Ext.layout.ContainerLayout, { for(i = 0; i < len; i++){ r = rs[i]; + m = r.getPositionEl().getMargins('tb'); + margins[i] = m; if(!r.rowHeight){ - ph -= (r.getHeight() + r.getEl().getMargins('tb')); + ph -= (r.getHeight() + m); } } @@ -134,8 +149,9 @@ Ext.ux.layout.RowLayout = Ext.extend(Ext.layout.ContainerLayout, { for(i = 0; i < len; i++){ r = rs[i]; + m = margins[i]; if(r.rowHeight){ - r.setSize({height: Math.floor(r.rowHeight*ph) - r.getEl().getMargins('tb')}); + r.setSize({height: Math.floor(r.rowHeight*ph) - m}); } } @@ -146,7 +162,6 @@ Ext.ux.layout.RowLayout = Ext.extend(Ext.layout.ContainerLayout, { var ts = this.getLayoutTargetSize(); if (ts.width != size.width){ this.adjustmentPass = true; - this.layoutTargetSize = ts; this.onLayout(ct, target); } }