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/04/04 21:02:08 UTC

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

Author: jmargaris
Date: Wed Apr  4 14:02:07 2007
New Revision: 525601

URL: http://svn.apache.org/viewvc?view=rev&rev=525601
Log:
changes to API during dojo upgrade to .4 broke some of this

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=525601&r1=525600&r2=525601
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/widgets/dojo/HorizontalPanel.js (original)
+++ incubator/xap/trunk/codebase/src/xap/widgets/dojo/HorizontalPanel.js Wed Apr  4 14:02:07 2007
@@ -158,8 +158,9 @@
 		
 		for (var i = 0; i < children.length; i++) {
 			var child = children[i];
-			if (child.domNode.flex){
-				dojo.style.setOuterWidth(child.domNode,dojo.style.getOuterWidth(child.domNode) + (flexUnit * child.domNode.flex));
+			if (child.domNode.flex){		
+				dojo.style.setMarginBox(child.domNode,
+					{width:dojo.style.getOuterWidth(child.domNode) + (flexUnit * child.domNode.flex)});
 				child.domNode.style.display = '';
 			}	
 		}
@@ -175,17 +176,12 @@
 			this.flex();
 		}
 		else{
-			this.resizeChildren();
+			xap.widgets.dojo.HorizontalPanel.superclass.onResized.call(this);
 		}
 	},
 	
 	resizeChildren: function(){
-		var children = this.children;
-		for (var i = 0; i<children.length;i++){
-			if(children[i].onResized){
-				children[i].onResized();
-			}
-		}
+		xap.widgets.dojo.HorizontalPanel.superclass.onResized.call(this);
 	}
 }
 );

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=525601&r1=525600&r2=525601
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/widgets/dojo/VerticalPanel.js (original)
+++ incubator/xap/trunk/codebase/src/xap/widgets/dojo/VerticalPanel.js Wed Apr  4 14:02:07 2007
@@ -18,7 +18,6 @@
  */
  
 
-
 Xap.provide("xap.widgets.dojo.VerticalPanel");
 
 dojo.require("dojo.widget.*");
@@ -136,7 +135,8 @@
 		for (var i = 0; i < children.length; i++) {
 			var child = children[i];
 			if (child.domNode.flex){
-				dojo.style.setOuterHeight(child.domNode,dojo.style.getOuterHeight(child.domNode) + (flexUnit * child.domNode.flex));
+				dojo.style.setMarginBox(child.domNode,
+					{height:dojo.style.getOuterHeight(child.domNode) + (flexUnit * child.domNode.flex)});
 				child.domNode.style.display='';
 			}	
 		}
@@ -144,12 +144,15 @@
     	
     },
     
-    onParentResized: function(){
+    checkSize: function(){
     	//IMPORTANT for efficiency if _totalFlex is zero
     	//can we use the old behavior and check isResized()?
     	//Seems like it but not 100% sure.
+    	if (!this._totalFlex){
+    		xap.widgets.dojo.VerticalPanel.superclass.checkSize.call(this);
+    	}
     	
-    	
+    	else{
     	//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
@@ -161,7 +164,8 @@
    		//TODO what about a horizontal panel inside of another
    		//horizontal panel?? Same problem??
    		//revisit this at some point
-		this.onResized();
+			this.onResized();
+		}
 	},
 	
 	
@@ -171,17 +175,12 @@
 			this.flex();
 		}
 		else{
-			this.resizeChildren();
+			xap.widgets.dojo.VerticalPanel.superclass.onResized.call(this);
 		}
 	},
 	
 	resizeChildren: function(){
-		var children = this.children;
-		for (var i = 0; i<children.length;i++){
-			if(children[i].onResized){
-				children[i].onResized();
-			}
-		}
+		xap.widgets.dojo.VerticalPanel.superclass.onResized.call(this);
 	}
 }
 );