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 mt...@apache.org on 2007/03/20 04:15:48 UTC

svn commit: r520266 - /incubator/xap/trunk/codebase/src/xap/widgets/dojo/BorderPanel.js

Author: mturyn
Date: Mon Mar 19 21:15:47 2007
New Revision: 520266

URL: http://svn.apache.org/viewvc?view=rev&rev=520266
Log:
Altered onResized so that it won't attempt to layout members (e.g., the north panel) whose dom nodes have already been removed.

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

Modified: incubator/xap/trunk/codebase/src/xap/widgets/dojo/BorderPanel.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/widgets/dojo/BorderPanel.js?view=diff&rev=520266&r1=520265&r2=520266
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/widgets/dojo/BorderPanel.js (original)
+++ incubator/xap/trunk/codebase/src/xap/widgets/dojo/BorderPanel.js Mon Mar 19 21:15:47 2007
@@ -88,19 +88,30 @@
     onResized: function(){
     	this._resizePending = false;
 		var children = [];
-		if (this.north){
+		// For each of these we'll need to
+		// check both for the child and for
+		// its dom node---removing a panel
+		// leaves the member of this (e.g.
+		// this.center) but removes the cor-
+		// responding dom node---e.g. this.center.domNode
+		// Removing the child entirely seems to screw up
+		// adding another back in.
+		//IMPORTANT REVISIT THIS
+		// TODO:  see why this last is so, so that
+		// we can remove the member entirely:
+		if ( this.north && this.north.domNode ){
 			children.push({domNode: this.north.domNode, layoutAlign: "top"});
 		}
-		if (this.south){
+		if ( this.south && this.south.domNode ){
 			children.push({domNode: this.south.domNode, layoutAlign: "bottom"});
 		}
-		if (this.west){
+		if ( this.west && this.west.domNode ){
 			children.push({domNode: this.west.domNode, layoutAlign: "left"});
 		}
-		if (this.east){
+		if ( this.east && this.east.domNode ){
 			children.push({domNode: this.east.domNode, layoutAlign: "right"});
 		}
-		if (this.center){
+		if ( this.center && this.center.domNode ){
 			children.push({domNode: this.center.domNode, layoutAlign: "client"});
 		}
 		dojo.widget.html.layout(this.domNode,children);