X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1b19974b1209fdab6f35168290251572ca86f142..22408c3e5bbce14b70b56be3a02122e2db3de896:/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 c3169ca09..3bcdd4a19 100644 --- a/app/assets/javascripts/index/notes.js.erb +++ b/app/assets/javascripts/index/notes.js.erb @@ -1,7 +1,6 @@ function initializeNotes(map) { var noteLayer = map.noteLayer, - notes = {}, - newNote; + notes = {}; var noteIcons = { "new": L.icon({ @@ -32,18 +31,11 @@ function initializeNotes(map) { noteLayer.clearLayers(); notes = {}; } - }).on("popupclose", function (e) { - if (newNote && e.popup == newNote._popup) { - $(newNote).oneTime(10, "removenote", function () { - map.removeLayer(newNote); - newNote = null; - }); - } - }) + }); noteLayer.on('click', function(e) { OSM.route('/browse/note/' + e.layer.id); - }) + }); function updateMarker(marker, feature) { if (marker) { @@ -92,11 +84,11 @@ function initializeNotes(map) { notes[feature.properties.id] = updateMarker(marker, feature); } - for (id in oldNotes) { + for (var id in oldNotes) { noteLayer.removeLayer(oldNotes[id]); } noteLoader = null; } - }; + } }