X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..6a7e4474cba9d8be4b2ec445e10f1691f7277c50:/examples/ux/RowLayout.js diff --git a/examples/ux/RowLayout.js b/examples/ux/RowLayout.js index 85ec7648..01b1571f 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.0 + * 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); } }