]> git.openstreetmap.org Git - rails.git/commitdiff
Remove geolink class from add note button while adding notes
authorTom Hughes <tom@compton.nu>
Mon, 29 Jul 2013 21:49:59 +0000 (22:49 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 29 Jul 2013 21:49:59 +0000 (22:49 +0100)
This was lost in the recent UI work but is important to stop changes
in map location causing the button to be reenabled.

app/assets/javascripts/index/notes.js.erb

index d0f6cb3885d9de336937da4e340fade650145f3e..012538e1d2a4bf98b887773837450b6b2ed343b6 100644 (file)
@@ -191,7 +191,7 @@ function initializeNotes(map) {
       notes[feature.properties.id] = updateMarker(marker, feature);
       newNote = null;
 
       notes[feature.properties.id] = updateMarker(marker, feature);
       newNote = null;
 
-      addNoteButton.removeClass("disabled");
+      addNoteButton.removeClass("disabled").addClass("geolink");
     }
   }
 
     }
   }
 
@@ -226,7 +226,7 @@ function initializeNotes(map) {
 
     if (addNoteButton.hasClass("disabled")) return;
 
 
     if (addNoteButton.hasClass("disabled")) return;
 
-    addNoteButton.addClass("disabled");
+    addNoteButton.removeClass("geolink").addClass("disabled");
 
     map.addLayer(noteLayer);
 
 
     map.addLayer(noteLayer);
 
@@ -263,7 +263,7 @@ function initializeNotes(map) {
     newNote.addTo(noteLayer).bindPopup(popupContent[0], popupOptions()).openPopup();
 
     newNote.on("remove", function (e) {
     newNote.addTo(noteLayer).bindPopup(popupContent[0], popupOptions()).openPopup();
 
     newNote.on("remove", function (e) {
-      addNoteButton.removeClass("disabled");
+      addNoteButton.removeClass("disabled").addClass("geolink");
     }).on("dragstart", function (e) {
       $(newNote).stopTime("removenote");
     }).on("dragend", function (e) {
     }).on("dragstart", function (e) {
       $(newNote).stopTime("removenote");
     }).on("dragend", function (e) {