You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by jm...@apache.org on 2007/03/06 23:58:30 UTC

svn commit: r515376 - in /incubator/xap/trunk/codebase/src/xap/widgets/dojo: HorizontalPanel.js VerticalPanel.js

Author: jmargaris
Date: Tue Mar  6 15:58:29 2007
New Revision: 515376

URL: http://svn.apache.org/viewvc?view=rev&rev=515376
Log:
should be working ok with boxFlex on all browsers

Modified:
    incubator/xap/trunk/codebase/src/xap/widgets/dojo/HorizontalPanel.js
    incubator/xap/trunk/codebase/src/xap/widgets/dojo/VerticalPanel.js

Modified: incubator/xap/trunk/codebase/src/xap/widgets/dojo/HorizontalPanel.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/widgets/dojo/HorizontalPanel.js?view=diff&rev=515376&r1=515375&r2=515376
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/widgets/dojo/HorizontalPanel.js (original)
+++ incubator/xap/trunk/codebase/src/xap/widgets/dojo/HorizontalPanel.js Tue Mar  6 15:58:29 2007
@@ -72,6 +72,8 @@
 		
 		xap.widgets.dojo.HorizontalPanel.superclass.addChild.call(this,child, overrideContainerNode, pos, ref, insertIndex);
  
+ 		//TODO this whole thing does not need to be done every time,
+		//all we need to do here is stretch the particular new child
  		this.setAlign(this.align);
  		
  		if (!this._resizeTask && this.isShowing()){
@@ -143,11 +145,6 @@
 				child.domNode.style.display='none';
 			}
 		}
-		dojo.lang.setTimeout(this, this.finishFlex, 0);
-    },
-    
-    finishFlex:function(){
-    	var children = this.children;
     	
     	var contentWidth = dojo.style.getContentWidth(this.domNode);
 		var freeSpace = contentWidth;

Modified: incubator/xap/trunk/codebase/src/xap/widgets/dojo/VerticalPanel.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/widgets/dojo/VerticalPanel.js?view=diff&rev=515376&r1=515375&r2=515376
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/widgets/dojo/VerticalPanel.js (original)
+++ incubator/xap/trunk/codebase/src/xap/widgets/dojo/VerticalPanel.js Tue Mar  6 15:58:29 2007
@@ -52,7 +52,8 @@
 		this._totalFlex += flex;
 		xap.widgets.dojo.VerticalPanel.superclass.addChild.call(this, child, overrideContainerNode, pos, ref, insertIndex);
 		
-		
+		//TODO this whole thing does not need to be done every time,
+		//all we need to do here is stretch the particular new child
 		this.setAlign(this.align);
 		
 		if (!this._resizeTask && this.isShowing()){
@@ -121,11 +122,6 @@
 				child.domNode.style.display='none';
 			}
 		}
-		dojo.lang.setTimeout(this, this.finishFlex, 0);
-    },
-    
-    finishFlex: function(){
-    	var children = this.children;
 		
 		var contentHeight = dojo.style.getContentHeight(this.domNode);
 		var freeSpace = contentHeight;
@@ -147,6 +143,23 @@
 		this.resizeChildren();
     	
     },
+    
+    onParentResized: function(){
+    	
+    	//This used to do a check against isResized()
+    	//however that check fails on FF some times.
+    	//What appears to happen is that we have a flexible
+    	//component which is a table. Tables do not like to size
+    	//smaller than their given size. So what happens is we shrink down
+    	//but the inner table with a fixed size prevents us from actually
+    	//growing smaller, so we fail the isResized() test.
+   		//if(!this._isResized()){ return; }
+   		//TODO what about a horizontal panel inside of another
+   		//horizontal panel?? Same problem??
+   		//revisit this at some point
+		this.onResized();
+	},
+	
 	
 	onResized: function(){
 		delete this._resizeTask;
@@ -173,6 +186,7 @@
 //IMPORTANT DOJO DOJOBUG
 //I added the first part that checks for table, the dojo people have a fixme
 //the setOuterHeight stuff doesn't really work for table...this is just a hack for now...
+//This still hase some browser specific issues
 dojo.style.getBoxSizing = function(node){
 	if (node.nodeName=='table' || node.nodeName=='TABLE'){