X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9f025130fddd7b9c7314cfec36dbe160c41e6698..84f7d322d01639a9a4617ff2f3f635e2e1e2cfc6:/app/assets/javascripts/index/notes.js.erb diff --git a/app/assets/javascripts/index/notes.js.erb b/app/assets/javascripts/index/notes.js.erb index 4594f1c78..e67749f07 100644 --- a/app/assets/javascripts/index/notes.js.erb +++ b/app/assets/javascripts/index/notes.js.erb @@ -37,6 +37,7 @@ $(document).ready(function () { if (e.layer == noteLayer) { map.off("moveend", loadNotes); noteLayer.clearLayers(); + notes = {}; } }); @@ -44,6 +45,7 @@ $(document).ready(function () { if (newNote && e.popup == newNote._popup) { $(newNote).oneTime(10, "removenote", function () { map.removeLayer(newNote); + newNote = null; }); } }); @@ -169,6 +171,7 @@ $(document).ready(function () { $.ajax({ url: url, type: "POST", + oauth: true, data: { lat: location.lat, lon: location.lng, @@ -176,8 +179,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"); } }); @@ -189,6 +192,7 @@ $(document).ready(function () { $.ajax({ url: url, type: "POST", + oauth: true, data: { text: $(form.text).val() },