[Mapbender-commits] r7161 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Nov 24 11:20:46 EST 2010


Author: verenadiewald
Date: 2010-11-24 08:20:46 -0800 (Wed, 24 Nov 2010)
New Revision: 7161

Modified:
   trunk/mapbender/http/plugins/mb_metadata_wmc_edit.js
Log:
register loadwmc event loaded

Modified: trunk/mapbender/http/plugins/mb_metadata_wmc_edit.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_wmc_edit.js	2010-11-24 16:20:08 UTC (rev 7160)
+++ trunk/mapbender/http/plugins/mb_metadata_wmc_edit.js	2010-11-24 16:20:46 UTC (rev 7161)
@@ -116,24 +116,23 @@
 		var formData = arguments.length >= 2 ? arguments[1] : undefined;
 		
 		if (!formReady) {
-			$metadataForm.load("../plugins/mb_metadata_wmc_edit.php", function () {
-				$metadataForm.find(".help-dialog").helpDialog();
-				$metadataForm.find(".original-metadata-wmc").bind("click", function() {
-					showOriginalMetadata();
-				});				
-				validator = $metadataForm.validate({
-					submitHandler: function () {
-						return false;
-					}
-				});
-				if (formData !== undefined) {
-					fillForm(obj, formData);
+			$metadataForm.empty().append($metadataEdit.children("div")).children().show();
+			$metadataForm.find(".help-dialog").helpDialog();
+			$metadataForm.find(".original-metadata-wmc").bind("click", function() {
+				showOriginalMetadata();
+			});				
+			validator = $metadataForm.validate({
+				submitHandler: function () {
+					return false;
 				}
-				else {
-					fillForm(obj);
-				}
-				formReady = true;
 			});
+			if (formData !== undefined) {
+				fillForm(obj, formData);
+			}
+			else {
+				fillForm(obj);
+			}
+			formReady = true;
 			return;
 		}
 		fillForm(obj);
@@ -150,6 +149,14 @@
 	});
 	Mapbender.events.init.register(function () {
 		that.valid();
+		$("<div></div>").insertAfter($metadataForm).hide().load("../plugins/mb_metadata_wmc_edit.php");
+		var loadwmc = $("#loadwmc").mapbender();
+		var map = $("#mapframe1").mapbender();
+		var width = map.getWidth();
+		var height = map.getHeight();
+		loadwmc.events.loaded.register(function () {
+			map.setDimensions(width, height);
+		});
 	});
 };
 



More information about the Mapbender_commits mailing list