Stop newly added notes disappearing
authorTom Hughes <tom@compton.nu>
Tue, 5 Feb 2013 19:03:13 +0000 (19:03 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 5 Feb 2013 19:03:13 +0000 (19:03 +0000)
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");
       }
     });