incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r428481 - /incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js
Date Thu, 03 Aug 2006 19:10:03 GMT
Author: mturyn
Date: Thu Aug  3 12:10:03 2006
New Revision: 428481

URL: http://svn.apache.org/viewvc?rev=428481&view=rev
Log:
Handles default or specified location in DOM now.

Modified:
    incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js

Modified: incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js?rev=428481&r1=428480&r2=428481&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js Thu Aug  3 12:10:03 2006
@@ -112,22 +112,30 @@
 		}
 		delete propertyMap.dojoType ;		
 
-	    var parentDomNode = this.getOriginalDomNode() ; 
+
 		var parent = this.getElement().getParent();
 		var handler = this.getUiContentHandler().getHandlerForElement( parent );
-		var parentPeer = handler.getPeer();
+		var parentPeerNode = handler.getPeer();
       
     
 		// This is necessary if a Dojo widget is the parentPeer:
 		// This is probably a kludge, but I don't want to
 		// muck around with handler.getPeer() at the moment:
-		if( parentPeer.containerNode ){
-			parentPeer = parentPeer.containerNode ;
+		if( parentPeerNode.containerNode ){
+			parentPeerNode = parentPeerNode.containerNode ;
 		}	    
+
+		// If we've specified a node....
+	    var specifiedDomNode = this.getOriginalDomNode() ;
+	    if ( specifiedDomNode){
+	    	parentPeerNode = specifiedDomNode ;
+	    }
 	    
 	    var tmp = document.createElement('div');
-	    tmp.parent = parentPeer  ;
-	    parentPeer.appendChild(tmp) ;
+	    
+
+	    tmp.parent = parentPeerNode ;
+	    parentPeerNode.appendChild(tmp) ;
 
 		if (dojoType == null ){
 			throw new xap.util.Exception("No dojo type specified by class or passed-in map.") ;		
@@ -314,9 +322,6 @@
 }
 
 
-xap.bridges.dojo.DojoWidgetBridge.prototype.getOriginalDomNode = function(){
-	return document.createElement("div") ;
-} 
 
 xap.bridges.dojo.DojoWidgetBridge.prototype.getRootDomNode = function(){
 	return this._peer.domNode;



Mime
View raw message