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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jan 23 02:11:38 PST 2019


Author: armin11
Date: 2019-01-23 02:11:38 -0800 (Wed, 23 Jan 2019)
New Revision: 10038

Modified:
   trunk/mapbender/http/javascripts/mod_addWMS.php
Log:
Fix for opening window more than once: http://www.geoportal.rlp.de/trac/ticket/79

Modified: trunk/mapbender/http/javascripts/mod_addWMS.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_addWMS.php	2019-01-22 14:37:18 UTC (rev 10037)
+++ trunk/mapbender/http/javascripts/mod_addWMS.php	2019-01-23 10:11:38 UTC (rev 10038)
@@ -62,31 +62,41 @@
     return url;
 }
 
+var opened = false;
+
 function mod_addWMS() {
-    var dialogContainer = $("<form/>")
-    var input = $("<input type='text' name='test' style='margin:5px 0px;width:100%;' placeholder='URL eingeben'/>");
-    var label = "<div>Capabilities - URL:</div>";
-    var submitButton = $("<input type='submit' title='Speichern'/>");
+    if (!opened) {
+        opened = true
+        var dialogContainer = $("<form/>")
+        var input = $("<input type='text' name='test' style='margin:5px 0px;width:100%;' placeholder='URL eingeben'/>");
+        var label = "<div>Capabilities - URL:</div>";
+        var submitButton = $("<input type='submit' title='Speichern'/>");
 
-    submitButton.click(function ( event ) {
-        dialogContainer.dialog("close");
-        event.preventDefault();
-        var url = input.val().trim();
-        if (validateUrl(url)) {
-            mod_addWMS_load(paramterbuild(url));
-        } else {
-            input.css({border: '1px solid #FF435C'});
-            //input.addClass()
-            //debugger;
-            dialogContainer.dialog({title: "Es handelt sich nicht um eine URL."});
-        }
-    });
+        submitButton.click(function ( event ) {
+            dialogContainer.dialog("close");
+            event.preventDefault();
+            var url = input.val().trim();
+            if (validateUrl(url)) {
+                mod_addWMS_load(paramterbuild(url));
+            } else {
+                input.css({border: '1px solid #FF435C'});
+                //input.addClass()
+                //debugger;
+                dialogContainer.dialog({title: "Es handelt sich nicht um eine URL."});
+            }
+        });
 
-    dialogContainer.append(label);
-    dialogContainer.append(input);
-    dialogContainer.append(submitButton);
+        dialogContainer.append(label);
+        dialogContainer.append(input);
+        dialogContainer.append(submitButton);
 
-    dialogContainer.dialog({title: "WebMapService hinzufügen"});
+        dialogContainer.dialog({
+            title: "WebMapService hinzufügen",
+            close: function () {
+                opened = false;
+            }
+        });
+    }
 }
 
 function base64_encode(data) {



More information about the Mapbender_commits mailing list