[Mapbender-commits] r6835 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Aug 30 07:35:59 EDT 2010


Author: verenadiewald
Date: 2010-08-30 11:35:59 +0000 (Mon, 30 Aug 2010)
New Revision: 6835

Modified:
   trunk/mapbender/http/javascripts/mod_loadwmc.js
Log:
http://trac.osgeo.org/mapbender/ticket/681

Modified: trunk/mapbender/http/javascripts/mod_loadwmc.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_loadwmc.js	2010-08-30 08:52:00 UTC (rev 6834)
+++ trunk/mapbender/http/javascripts/mod_loadwmc.js	2010-08-30 11:35:59 UTC (rev 6835)
@@ -61,9 +61,10 @@
 	var that = this;
 	var serverSideFileName = "../php/mod_loadwmc_server.php";
 	var wmcTable;
-	var wmcPopup = null;
-	var wmcDisplayPopup = null;
-	var wmcOpenLayersPopup = null;
+	var $wmcPopup = null;
+	var $wmcDisplayPopup = null;
+	var $wmcOpenLayersPopup = null;
+	var wmcPopupHtml = null;
 	var wmcListTableInitialized = false;
 
 	var LOAD_WMC_OPTIONS = {
@@ -131,22 +132,21 @@
 		// the pop up allows you to load, append, merge, 
 		// display and delete WMC documents
 		if (tagName === "IMG") {
-			if (wmcPopup === null) {
-				wmcPopup = new mb_popup({
-					title: options.currentTitle,
-					width: 750,
-					height: 500,
-					top: 50,
-					left: 100,
-					html: getInitialDialogHtml(options.id)
-				});
+			if($wmcPopup) {
+				$wmcPopup.dialog('destroy');
+				$wmcPopup.remove();
 			}
-			
-			// display the pop up
-			if (!wmcPopup.isVisible()) {
-				wmcPopup.setHtml(getInitialDialogHtml(options.id));
-				wmcPopup.show();
-			}
+			wmcPopupHtml = getInitialDialogHtml(options.id);
+			$wmcPopup = $(wmcPopupHtml);
+			$wmcPopup.dialog({
+				title: options.currentTitle,
+				bgiframe: true,
+				autoOpen: true,
+				modal: false,
+				width: 750,
+				height: 500,
+				pos: [100,50]
+			});
 		}
 		else {
 			$loadWmc.html(getInitialDialogHtml(options.id));
@@ -156,58 +156,53 @@
 	};
 	
 	this.hide = function () {
-		if (wmcPopup !== null && wmcPopup.isVisible()) {
-			wmcPopup.hide();
+		if($wmcPopup.size() > 0) {
+			$wmcPopup.dialog('destroy');
+			$wmcPopup.remove();
 		}
 		this.hideWmcXml();
 		this.hideOpenLayers();
 	};
 	
 	this.showWmcXml = function (id) {
+		this.hideWmcXml();
 		var url = "../javascripts/mod_displayWmc.php?wmc_id=" + id + "&" + mb_session_name + "=" + mb_nr;
-		if (wmcDisplayPopup === null) {
-			wmcDisplayPopup = new mb_popup({
-				title: translatedI18nObject.labelWmcDocument,
-				width: 600,
-				height: 500,
-				top: 50,
-				left: 700,
-				url: url
-			});
-		}
-		else {
-			wmcDisplayPopup.setUrl(url);
-		}
-		wmcDisplayPopup.show();
+		var $wmcDisplayPopup = $('<div class="wmcDisplayPopup"><iframe style="width:99%;height:99%;" src="' + url + '"></iframe></div>');
+		$wmcDisplayPopup.dialog({
+			title: translatedI18nObject.labelWmcDocument,
+			bgiframe: true,
+			autoOpen: true,
+			modal: false,
+			width: 600,
+			height: 500,
+			pos: [700,50]
+		});
 	};
 	
 	this.hideWmcXml = function () {
-		if (wmcDisplayPopup !== null && wmcDisplayPopup.isVisible()) {
-			wmcDisplayPopup.hide();
+		if($('.wmcDisplayPopup').size() > 0) {
+			$('.wmcDisplayPopup').dialog('destroy');
 		}
 	};
 	
 	this.showOpenLayers = function (id) {
+		this.hideOpenLayers();
 		var url = "../php/mod_wmc2ol.php?wmc_id=" + id + "&" + mb_session_name + "=" + mb_nr;
-		if (wmcOpenLayersPopup === null) {
-			wmcOpenLayersPopup = new mb_popup({
-				title: translatedI18nObject.labelOpenLayers,
-				width: 600,
-				height: 500,
-				top: 40,
-				left: 600,
-				url: url
-			});
-		}
-		else {
-			wmcOpenLayersPopup.setUrl(url);
-		}
-		wmcOpenLayersPopup.show();
+		var $wmcOpenLayersPopup = $('<div class="wmcOpenLayersPopup"><iframe style="width:99%;height:99%;" src="' + url + '"></iframe></div>');
+		$wmcOpenLayersPopup.dialog({
+			title: translatedI18nObject.labelOpenLayers,
+			bgiframe: true,
+			autoOpen: true,
+			modal: false,
+			width: 600,
+			height: 500,
+			pos: [600,40]
+		});
 	};
 	
 	this.hideOpenLayers = function () {
-		if (wmcOpenLayersPopup !== null && wmcOpenLayersPopup.isVisible()) {
-			wmcOpenLayersPopup.hide();
+		if($('.wmcOpenLayersPopup').size() > 0) {
+			$('.wmcOpenLayersPopup').dialog('destroy');
 		}
 	};
 	



More information about the Mapbender_commits mailing list