Andrew Shadura avatar Andrew Shadura committed 17d882e

make it possible to do edits with zoom levels from 14 up to 16 --- with confirmation

Comments (0)

Files changed (1)

public_html/js/tt.js

     removeedit(editing);
     if (uploading) return;
     if (map.zoom < 16) {
-        questionform.className = "form hidden";
-        questionform.innerHTML = "<div style='width: 300px; height: 100px;'>" +
-         "<p style='text-align: center;'>" + OpenLayers.i18n("Please zoom in to be able to select features") + "</p>" +
-         "<p style='text-align: center;'><button id='cancelbtn'>" + OpenLayers.i18n("Dismiss") + "</button></p></div>";
-        questionform.style.display = "block";
-        $("cancelbtn").onclick = function () {
-            questionform.style.display = "none";
-            return false;
+        if (map.zoom < 14) {
+            questionform.className = "form hidden";
+            questionform.innerHTML = "<div style='width: 300px; height: 100px;'>" +
+             "<p style='text-align: center;'>" + OpenLayers.i18n("Please zoom in to be able to select features") + "</p>" +
+             "<p style='text-align: center;'><button id='cancelbtn'>" + OpenLayers.i18n("Dismiss") + "</button></p></div>";
+            questionform.style.display = "block";
+            $("cancelbtn").onclick = function () {
+                questionform.style.display = "none";
+                return false;
+            }
+        } else {
+            questionform.className = "form hidden";
+            questionform.innerHTML = "<div style='width: 300px; height: 100px;'>" +
+             "<p style='text-align: center;'>" + OpenLayers.i18n("Please zoom in to be able to select features") + "</p>" +
+             "<p style='text-align: center;'><button id='cancelbtn'>" + OpenLayers.i18n("Dismiss") + "</button>" +
+             "<button id='loadbtn'>" + OpenLayers.i18n("Load anyway") + "</button></p></div>";
+            questionform.style.display = "block";
+            $("cancelbtn").onclick = function () {
+                questionform.style.display = "none";
+                return false;
+            }
+            $("loadbtn").onclick = function () {
+                if (!modified) {
+                    questionform.style.display = "none";
+                    actuallyloadfeatures(url);
+                } else {
+                    questionform.className = "form attention hidden";
+                    questionform.innerHTML = "<div style='width: 300px; height: 100px;'>" +
+                     "<p style='text-align: center;'>" + OpenLayers.i18n("You have unsaved changes. If you proceed, these changes will be lost") + "</p>" +
+                     "<p style='text-align: center;'><button id='cancelbtn'>" + OpenLayers.i18n("Cancel") + "</button>" +
+                     "<button id='discardbtn'>" + OpenLayers.i18n("Discard changes") + "</button></p></div>";
+                    questionform.style.display = "block";
+                    $("cancelbtn").onclick = function () {
+                        questionform.style.display = "none";
+                        return false;
+                    }
+                    $("discardbtn").onclick = function () {
+                        questionform.style.display = "none";
+                        actuallyloadfeatures(url);
+                        return false;
+                    }
+                }
+                return false;
+            }
         }
         return;
     } else {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.