[Dojo-checkins] elazutkin - r16314 - dojox/trunk/form/manager

dojo-checkins-admin at dojotoolkit.org dojo-checkins-admin at dojotoolkit.org
Tue Jan 13 07:06:09 UTC 2009


Author: elazutkin
Date: Mon Jan 12 23:06:06 2009
New Revision: 16314

Modified:
   dojox/trunk/form/manager/_NodeMixin.js
Log:
Introducing the scope to the registerNode(), !strict.

Modified: dojox/trunk/form/manager/_NodeMixin.js
==============================================================================
--- dojox/trunk/form/manager/_NodeMixin.js	(original)
+++ dojox/trunk/form/manager/_NodeMixin.js	Mon Jan 12 23:06:06 2009
@@ -36,11 +36,12 @@
 			return eventName;	// String
 		},
 
-		registerNode = function(node){
+		registerNode = function(node, groupNode){
 			var name = dojo.attr(node, "name");
+			groupNode = groupNode || this.domNode;
 			if(name && !(name in this.formWidgets)){
 				// verify that it is not part of any widget
-				for(var n = node; n !== this.domNode; n = n.parentNode){
+				for(var n = node; n && n !== groupNode; n = n.parentNode){
 					if(dojo.attr(n, "widgetId") && dijit.byNode(n) instanceof dijit.form._FormWidget){
 						// this is a child of some widget --- bail out
 						return null;
@@ -167,7 +168,9 @@
 			}
 
 			dojo.query("input, select, textarea, button", node).
-				map(registerNode, this).
+				map(function(n){
+					return registerNode.call(this, n, node);
+				}, this).
 				forEach(function(name){
 					if(name){
 						connectNode.call(this, name, getObserversFromNode.call(this, name));


More information about the Dojo-checkins mailing list