incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r520598 - /incubator/xap/trunk/codebase/src/xap/widgets/dojo/BorderPanel.js
Date Tue, 20 Mar 2007 21:12:18 GMT
Author: mturyn
Date: Tue Mar 20 14:12:17 2007
New Revision: 520598

URL: http://svn.apache.org/viewvc?view=rev&rev=520598
Log:
Altered so that when we remove a panel, we defintiely remove the panel widget as well as the
panel's dom node.

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=520598&r1=520597&r2=520598
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/widgets/dojo/BorderPanel.js (original)
+++ incubator/xap/trunk/codebase/src/xap/widgets/dojo/BorderPanel.js Tue Mar 20 14:12:17 2007
@@ -74,9 +74,29 @@
 		}
 	},
 	
+	allowedPositions:{east:"right",west:"left",north:"top",south:"bottom",center:"client"},
+
+	
 	removeChild: function(child) {
+	
 	 	var containerNode = child.domNode.parentNode;		 	
 		xap.widgets.dojo.BorderPanel.superclass.removeChild.call(this,child);
+		
+		// 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
+		// ---so we'll have to remove it by hand.
+		//IMPORTANT REVISIT THIS
+		// TODO:  see why this  is so; how did this work in Dojo_.3
+		for( var position in this.allowedPositions ){
+			if( child == this[position]){
+				this[position] = null;
+			}
+		}		
+		
 		if (!this._resizePending){
 			if(this.isShowing()){
 				dojo.lang.setTimeout(this, this.onResized, 0);
@@ -88,30 +108,20 @@
     onResized: function(){
     	this._resizePending = false;
 		var children = [];
-		// 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 ){
+
+		if ( this.north ){
 			children.push({domNode: this.north.domNode, layoutAlign: "top"});
 		}
-		if ( this.south && this.south.domNode ){
+		if ( this.south ){
 			children.push({domNode: this.south.domNode, layoutAlign: "bottom"});
 		}
-		if ( this.west && this.west.domNode ){
+		if ( this.west ){
 			children.push({domNode: this.west.domNode, layoutAlign: "left"});
 		}
-		if ( this.east && this.east.domNode ){
+		if ( this.east ){
 			children.push({domNode: this.east.domNode, layoutAlign: "right"});
 		}
-		if ( this.center && this.center.domNode ){
+		if ( this.center ){
 			children.push({domNode: this.center.domNode, layoutAlign: "client"});
 		}
 		dojo.widget.html.layout(this.domNode,children);



Mime
View raw message