]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/notes.js.erb
Stop newly added notes disappearing
[rails.git] / app / assets / javascripts / index / notes.js.erb
index 4594f1c782bf3fd1c692b2321c01459f012372fc..bff4c446c371380261f095ac74fb3db695fb935d 100644 (file)
@@ -44,6 +44,7 @@ $(document).ready(function () {
     if (newNote && e.popup == newNote._popup) {
       $(newNote).oneTime(10, "removenote", function () {
         map.removeLayer(newNote);
+        newNote = null;
       });
     }
   });
@@ -176,8 +177,8 @@ $(document).ready(function () {
       },
       success: function (feature) {
         notes[feature.properties.id] = updateMarker(marker, feature);
+        newNote = null;
 
-        $(".leaflet-popup-close-button").off("click.close");
         $("#createnoteanchor").removeClass("disabled").addClass("geolink");
       }
     });