[Dojo-checkins] r755 - src/webui

dojo-checkins at dojotoolkit.org dojo-checkins at dojotoolkit.org
Tue Jun 21 23:48:24 PDT 2005


Author: alex
Date: Tue Jun 21 23:48:23 2005
New Revision: 755

Modified:
   src/webui/DomWidget.js
Log:
make sure that dojoOn* event's aren't getting fired multiple times for the same listeners


Modified: src/webui/DomWidget.js
==============================================================================
--- src/webui/DomWidget.js	(original)
+++ src/webui/DomWidget.js	Tue Jun 21 23:48:23 2005
@@ -184,12 +184,18 @@
 	// var lstr = str.toLowerCase();
 	var re = /(dojoOn([a-z]+)(\s?))=/gi;
 	var evts = str ? str.match(re)||[] : [];
+	var ret = [];
+	var lem = {};
 	for(var x=0; x<evts.length; x++){
 		if(evts[x].legth < 1){ continue; }
 		var cm = evts[x].replace(/\s/, "");
-		evts[x] = (cm.slice(0, cm.length-1));
+		cm = (cm.slice(0, cm.length-1));
+		if(!lem[cm]){
+			lem[cm] = true;
+			ret.push(cm);
+		}
 	}
-	return evts;
+	return ret;
 }
 
 


More information about the Dojo-checkins mailing list