[Mapbender-commits] r6322 - trunk/mapbender/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jun 18 04:36:59 EDT 2010


Author: christoph
Date: 2010-06-18 08:36:59 +0000 (Fri, 18 Jun 2010)
New Revision: 6322

Modified:
   trunk/mapbender/lib/wizard.js
Log:


Modified: trunk/mapbender/lib/wizard.js
===================================================================
--- trunk/mapbender/lib/wizard.js	2010-06-18 08:30:14 UTC (rev 6321)
+++ trunk/mapbender/lib/wizard.js	2010-06-18 08:36:59 UTC (rev 6322)
@@ -26,14 +26,32 @@
 
 	return this.each(function () {
 		var wizardInstance = this;
+		$(wizardInstance).data("isWizard", true);
 		$("a.wizard").live("click", function (e) {
 			var href = $(this).attr("href");
 			var $target = $(href);
-			console.log(wizardInstance);
-			console.log($target.parents());
-			if ($target.size() === 0 || wizardInstance !== $target.parent().get(0)) {
+			var found = false;
+			var abort = false;
+			$target.parents().each(function () {
+				if (abort || found) {
+					return;
+				}
+				var $currentElement = $(this);
+				// not this target's wizard
+				if ($(this).data("isWizard") && this !== wizardInstance) {
+					abort = true;
+					return;
+				}				
+				// this target's wizard
+				if ($(this).data("isWizard") && this === wizardInstance) {
+					found = true;
+					return;
+				}				
+			});
+			if (abort || !found) {
 				return;
 			}
+			
 			new Mapbender.Warning("Clicked link " + href + " in wizard " + wizardInstance.id);
 
 			clickHandler(e, $target);



More information about the Mapbender_commits mailing list