X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..c8256059947f3aa8f5b0a9a2acf55e2142bb4742:/examples/ux/RowLayout.js diff --git a/examples/ux/RowLayout.js b/examples/ux/RowLayout.js index 85ec7648..4a4039bc 100644 --- a/examples/ux/RowLayout.js +++ b/examples/ux/RowLayout.js @@ -1,6 +1,6 @@ /*! - * Ext JS Library 3.1.1 - * Copyright(c) 2006-2010 Ext JS, LLC + * Ext JS Library 3.2.1 + * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ @@ -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); } }