From: Anton Khorev Date: Wed, 25 Dec 2024 02:08:44 +0000 (+0300) Subject: Remove active class from addNoteButton only in page.unload() X-Git-Tag: live~70^2~3 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/17ab002c04d8e2358bc1c511b0d7dba051885ed1?hp=5542858315f89d73cd13b1292acbbddb7de678cc Remove active class from addNoteButton only in page.unload() Same reasons as in the previous commit. --- diff --git a/app/assets/javascripts/index/new_note.js b/app/assets/javascripts/index/new_note.js index eab4b258a..6cb8db215 100644 --- a/app/assets/javascripts/index/new_note.js +++ b/app/assets/javascripts/index/new_note.js @@ -96,9 +96,7 @@ OSM.NewNote = function (map) { newNoteMarker.addTo(map); addHalo(newNoteMarker.getLatLng()); - newNoteMarker.on("remove", function () { - addNoteButton.removeClass("active"); - }).on("dragend", function () { + newNoteMarker.on("dragend", function () { content.find("textarea").focus(); }); } @@ -158,7 +156,6 @@ OSM.NewNote = function (map) { createNote(location, text, (feature) => { content.find("textarea").val(""); addCreatedNoteMarker(feature); - addNoteButton.removeClass("active"); OSM.router.route("/note/" + feature.properties.id); }); });