PDA

View Full Version : [UNKNOWN][3.??] Apply this small patch set



meroy
26 Dec 2009, 9:11 AM
Apply to SVN 5820/5821. It addresses issues for autoWidth/Height and tab panels not rendering unless resized. The 2 lines changes in Container.js below were somehow missed when the layout changes were made in SVN 5691. You will appreciate 3.1 with this. Look here: http://www.extjs.com/forum/showthread.php?p=422244#post422244



diff -r -U 4 svn.ext-5820/src/widgets/Container.js svn.ext-5820-c/src/widgets/Container.js
--- svn.ext-5820/src/widgets/Container.js 2009-12-22 03:42:34.000000000 -0500
+++ svn.ext-5820-c/src/widgets/Container.js 2009-12-24 05:31:59.000000000 -0500
@@ -495,9 +495,9 @@
this.doLayout(false, true);
}

if(this.monitorResize === true){
- Ext.EventManager.onWindowResize(this.doLayout, this, [false]);
+ Ext.EventManager.onWindowResize(this.layout.layout, this.layout);
}
},

/**
@@ -880,9 +880,9 @@
this.doRemove(c, true);
}
}
if(this.monitorResize){
- Ext.EventManager.removeResizeListener(this.doLayout, this);
+ Ext.EventManager.removeResizeListener(this.layout.layout, this.layout);
}
Ext.destroy(this.layout);
Ext.Container.superclass.beforeDestroy.call(this);
},
diff -r -U 4 svn.ext-5820/src/widgets/layout/BoxLayout.js svn.ext-5820-c/src/widgets/layout/BoxLayout.js
--- svn.ext-5820/src/widgets/layout/BoxLayout.js 2009-12-22 03:42:34.000000000 -0500
+++ svn.ext-5820-c/src/widgets/layout/BoxLayout.js 2009-12-24 05:52:00.000000000 -0500
@@ -227,8 +227,14 @@
for (i = 0 ; i < csLen; i++) {
c = cs[i];
cm = c.margins;
totalFlex += c.flex || 0;
+
+ // autoHeight Containers must be fully laid out to acquire a height
+ if (c.doLayout && !c.height && !c.hasLayout) {
+ c.doLayout();
+ }
+
ch = c.getHeight();
margin = cm.top + cm.bottom;
extraHeight += ch + margin;
flexHeight += margin + (c.flex ? 0 : ch);
@@ -346,8 +352,14 @@

Ext.each(cs, function(c){
cm = c.margins;
totalFlex += c.flex || 0;
+
+ // autoWidth Containers must be fully laid out to acquire a width
+ if (c.doLayout && !c.width && !c.hasLayout) {
+ c.doLayout();
+ }
+
cw = c.getWidth();
margin = cm.left + cm.right;
extraWidth += cw + margin;
flexWidth += margin + (c.flex ? 0 : cw);
diff -r -U 4 svn.ext-5820/src/widgets/layout/CardLayout.js svn.ext-5820-c/src/widgets/layout/CardLayout.js
--- svn.ext-5820/src/widgets/layout/CardLayout.js 2009-12-10 22:23:57.000000000 -0500
+++ svn.ext-5820-c/src/widgets/layout/CardLayout.js 2009-12-26 11:47:06.000000000 -0500
@@ -86,9 +86,9 @@
renderHidden : true,

constructor: function(config){
Ext.layout.CardLayout.superclass.constructor.call(this, config);
- // this.forceLayout = (this.deferredRender === false);
+ this.forceLayout = (this.deferredRender === false);
},

/**
* Sets the active (visible) item in the layout.

meroy
26 Dec 2009, 9:19 AM
The change to CardLayout.js was done in SVN 5764. The diff above reverts just the change made to CardLayout.js. The change to Container.js (2 lines -- pulled from layout 2.0 code I had from @Animal) should have been applied with SVN 5761 at the time. The change to BoxLayout.js (from @Animal) addresses the issues some apps are having due to autoWidth/autoHeight issues.