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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jun 18 09:54:45 EDT 2010


Author: christoph
Date: 2010-06-18 13:54:45 +0000 (Fri, 18 Jun 2010)
New Revision: 6352

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


Modified: trunk/mapbender/lib/wizard.js
===================================================================
--- trunk/mapbender/lib/wizard.js	2010-06-18 13:38:50 UTC (rev 6351)
+++ trunk/mapbender/lib/wizard.js	2010-06-18 13:54:45 UTC (rev 6352)
@@ -10,12 +10,38 @@
 		$wiz.data("isWizard", true);
 
 		var o = $.extend({
-			fade: false
+			fade: false,
+			onClickLink: function () {
+				
+			}
 		}, options || {});
 		
+		var getPath = function ($t) {
+			var m = $t.metadata({
+				type: "attr",
+				name: "data"
+			});
+			if (m && m.path) {
+				var p = m.path.split("/");
+				var pathArray = [];
+				$.each(p, function (i, val) {
+					var dom = $(val);
+					if (dom.size() !== 1) {
+						return;
+					}
+					pathArray.push(dom);
+				});
+					
+				o.onClickLink({
+					path: pathArray
+				});			
+			}
+		};
+		
 		var clickHandler = function (e, $t) {
 			$t.siblings("div").hide();
 			$t.show();
+			getPath($t);
 			e.preventDefault();
 		};
 	
@@ -24,27 +50,7 @@
 				$t.siblings("div:visible").fadeOut(function () {
 					$t.fadeIn();
 				});
-				var m = $t.metadata({
-					type: "attr",
-					name: "data"
-				});
-				if (m && m.path) {
-					var p = m.path.split("/");
-					var pathArray = [];
-					$.each(p, function (i, val) {
-						console.log(val);
-						var dom = $(val);
-						if (dom.size() !== 1) {
-							return;
-						}
-						pathArray.push("<a class='wizard' href='" + 
-							val + "'>" + dom.attr("title") + "</a>");
-						
-					});
-						
-					console.log(pathArray.join(" / "));
-					
-				}
+				getPath($t);
 				e.preventDefault();
 			};
 		}



More information about the Mapbender_commits mailing list