incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r486482 - in /incubator/xap/trunk/src/xap: bridges/dojo/TableBridge.js bridges/dojo/WindowBridge.js widgets/dojo/TreeTable.js widgets/dojo/Window.js
Date Wed, 13 Dec 2006 04:01:58 GMT
Author: mturyn
Date: Tue Dec 12 20:01:57 2006
New Revision: 486482

URL: http://svn.apache.org/viewvc?view=rev&rev=486482
Log:
>From Rob Gagne

1. Cleaned up the Window resizeTo handling
2. Fixed remove row problem; it was removing things other than row
3. Some additional resize handling

Modified:
    incubator/xap/trunk/src/xap/bridges/dojo/TableBridge.js
    incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js
    incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js
    incubator/xap/trunk/src/xap/widgets/dojo/Window.js

Modified: incubator/xap/trunk/src/xap/bridges/dojo/TableBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/TableBridge.js?view=diff&rev=486482&r1=486481&r2=486482
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/TableBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/dojo/TableBridge.js Tue Dec 12 20:01:57 2006
@@ -135,6 +135,12 @@
 
 // handler for removing childred
 xap.bridges.dojo.TableBridge.prototype.removeChild = function( childHandler ){
-	var peer = this.getPeer() ;
-	if (peer) peer.removeRow(childHandler.getPeer());
+	var childPeer = childHandler.getPeer();
+	if (childPeer instanceof xap.widgets.dojo.TableColumn){
+		//TODO make this work by adding a remove column
+		// this.getPeer().removeColumn(childPeer);
+	}
+	else if (childPeer instanceof xap.widgets.dojo.TableRow){
+		this.getPeer().removeRow(childPeer);
+	}
 }

Modified: incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js?view=diff&rev=486482&r1=486481&r2=486482
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js Tue Dec 12 20:01:57 2006
@@ -142,7 +142,7 @@
 	this.getPeer().containerNode.parentNode.removeChild(this.getPeer().containerNode);
 	this.getPeer().domNode.appendChild(childHandler.getRootDomNode());
 	this.getPeer().containerNode = childHandler.getRootDomNode();
-	this.getPeer()._containerChild = childHandler;
+	this.getPeer()._childPeer = childHandler.getPeer();
 	
 	//IMPORTANT remove this later, workaround only
 	childHandler.getRootDomNode().style.overflow = "hidden";

Modified: incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js?view=diff&rev=486482&r1=486481&r2=486482
==============================================================================
--- incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js (original)
+++ incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js Tue Dec 12 20:01:57 2006
@@ -54,7 +54,6 @@
 	this._alternateRowClass = "alternateRow";
 	this._tableCellClass = "tableCell";
 	this._headerVisibility = "visible";
-	this._isResized = true;
 }
 
 dojo.inherits(xap.widgets.dojo.TreeTable,dojo.widget.HtmlWidget);
@@ -171,7 +170,7 @@
 			// we want the greater of explicity set, calculated column or calculated cell; note that
we need to look up
 			// the explicity set ones in case the table is hidden when created
 			var finalWidth = headerWidth>columnWidth ? headerWidth:columnWidth;
-			var finalWidth = setWidth>finalWidth?setWidth:finalWidth;
+			finalWidth = setWidth>finalWidth?setWidth:finalWidth;			
 			this._columns[i]._calculatedWidth = finalWidth + "px";
 			tableWidth += finalWidth;
 		}
@@ -207,7 +206,8 @@
 				this.headerTable.childNodes[i].style.width = width;
 				this.table.childNodes[i].style.width = width;
 			}
-			this.headerRow.childNodes[i].childNodes[0].style.width  = "100%";
+			if (this.headerRow.childNodes[i].childNodes[0])
+				this.headerRow.childNodes[i].childNodes[0].style.width  = "100%";
 		}
 	},
 	
@@ -313,7 +313,7 @@
 			dojo.html.addClass(cell,'xapHeaderWrapper');	
 			this.headerRow.appendChild(cell);
 			cell.style.whiteSpace = "nowrap";
-			if (this._columns[i]._header._rootDomNode){	
+			if (this._columns[i]._header && this._columns[i]._header._rootDomNode){	
 				cell.appendChild(this._columns[i]._header._rootDomNode);
 			}
 			cell.style.visibility = this._headerVisibility;
@@ -390,7 +390,6 @@
 		
 		//TODO we should really be able to make this
 		//more efficient by inserting the column in place
-		this._rebuildTableLater();
 	},
 	
 	removeColumn: function(column){
@@ -428,6 +427,7 @@
 		//TODO we should be able to insert the row into the table
 		//at the right spot. Gets kind of tricky for nested rows and such,
 		//in that case you need to insert relative to a sibling
+		// TODO: maybe resize the columns when stuff is added
 		this._rebuildRowsLater();
 	},
 	

Modified: incubator/xap/trunk/src/xap/widgets/dojo/Window.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/Window.js?view=diff&rev=486482&r1=486481&r2=486482
==============================================================================
--- incubator/xap/trunk/src/xap/widgets/dojo/Window.js (original)
+++ incubator/xap/trunk/src/xap/widgets/dojo/Window.js Tue Dec 12 20:01:57 2006
@@ -123,28 +123,18 @@
 	// copied from Floating Pane
 	// This is called when the user adjusts the size of the floating pane
 	resizeTo: function(w, h){
-		dojo.style.setOuterWidth(this.domNode, w);
-		dojo.style.setOuterHeight(this.domNode, h);
-
-		dojo.html.layout(this.domNode,
-			[
-			  {domNode: this.titleBar, layoutAlign: "top"},
-			  {domNode: this.resizeBar, layoutAlign: "bottom"},
-			  {domNode: this.containerNode, layoutAlign: "client"}
-			] );
-
-		this.bgIframe.onResized();
-		if(this.shadow){ this.shadow.size(w, h); }
-		this.onResized();
+		// call the superclass resizeTo
+		xap.widgets.dojo.Window.superclass.resizeTo.call(this,w,h);
 		
 		// let the child node know that we're resizing
-		if (this._containerChild && this._containerChild.getPeer && this._containerChild.getPeer().onResized)
{
-			this._containerChild.getPeer().onResized();
+		if (this._childPeer && this._childPeer.onResized) {
+			this._childPeer.onResized();
 		}
 	},
 
 	resizeWindow: function(){
-		//logic copied from floating pane
+		// logic copied from floating pane
+		// called from setWidth and setHeight
 		dojo.html.layout(this.domNode,
 				[
 				  {domNode: this.titleBar, layoutAlign: "top"},



Mime
View raw message