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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jun 17 07:15:22 EDT 2010


Author: christoph
Date: 2010-06-17 11:15:22 +0000 (Thu, 17 Jun 2010)
New Revision: 6287

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


Modified: trunk/mapbender/lib/basic.js
===================================================================
--- trunk/mapbender/lib/basic.js	2010-06-17 10:30:38 UTC (rev 6286)
+++ trunk/mapbender/lib/basic.js	2010-06-17 11:15:22 UTC (rev 6287)
@@ -389,36 +389,32 @@
 		$module.find("a").each(function () {
 			$link = $(this);
 			var href = $link.attr("href");
-			console.log(href);
-			var target = $(href).mapbender();
-			console.log(target);
-/*			
-			var m = $link.metadata({
-				type: "attr",
-				name: "data"
-			});
-			
-			// check if metadata exists
-			if (!m || !m.target) {
-				return;
+			var $target = $(href);
+			var target = $target.mapbender();
+
+
+			var showTarget = function () {
+				$target.show();
+			};
+
+			if (typeof target === "object" && typeof target.show === "function") {
+				showTarget = function () {
+					target.show();
+				};
 			}
-			
-			// check if module exists and has show function
-			var target = $("#" + m.target).mapbender();
-*/
-			if (typeof target !== "object" || typeof target.show !== "function") {
-				return;
-			}
 
-			if (typeof module !== "object" || typeof module.hide !== "function") {
-				return;
+			var clickHandler = function () {
+				$module.hide();
+				showTarget();
+			};
+
+			if (typeof module === "object" && typeof module.hide === "function") {
+				clickHandler = function () {
+					module.hide(showTarget);
+				};
 			}
 
-			$link.bind("click", function () {
-				module.hide(function () {
-					target.show();								
-				});
-			});
+			$link.bind("click", clickHandler);
 		});		
 	});
 };



More information about the Mapbender_commits mailing list