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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jan 20 05:14:49 EST 2010


Author: christoph
Date: 2010-01-20 05:14:45 -0500 (Wed, 20 Jan 2010)
New Revision: 5362

Modified:
   trunk/mapbender/lib/basic.js
Log:
new selector for main maps

Modified: trunk/mapbender/lib/basic.js
===================================================================
--- trunk/mapbender/lib/basic.js	2010-01-20 10:08:15 UTC (rev 5361)
+++ trunk/mapbender/lib/basic.js	2010-01-20 10:14:45 UTC (rev 5362)
@@ -5,6 +5,10 @@
 	return ($(obj).data('isMap') === true);
 };
 
+$.expr[":"].mainMaps = function (obj) {
+	return ($(obj).data('isMap') === true && $(obj).data('isOverview') !== true);
+};
+
 $.expr[":"].modules = function (obj) {
 	return (typeof $(obj).mapbender() !== "undefined");
 };
@@ -74,15 +78,24 @@
 	}
 	// Get a value from an attribute
 	else if (arguments.length === 1 && typeof arguments[0] === "string") {
-		var attr = arguments[0];	
+		var module = this.data("api");
 
+		if (typeof module === "undefined") {
+			new Mb_exception("Module " + id + " is not present!");
+			return null;
+		}
+		return module[arguments[0]];
+	}
+	// Set an attribute
+	else if (arguments.length === 2 && typeof arguments[0] === "string") {
 		var module = this.data("api");
 
 		if (typeof module === "undefined") {
 			new Mb_exception("Module " + id + " is not present!");
 			return null;
 		}
-		return module[attr];
+		module[arguments[0]] = arguments[1];
+		return this;
 	}
 	// Use API functionality
 	else if (arguments.length === 1 && typeof arguments[0] === "function") {



More information about the Mapbender_commits mailing list