From c4709e2a05ef97f86006e60539db1e994201a5b3 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Wed, 25 Dec 2024 03:17:51 +0300 Subject: [PATCH 1/1] Rename newNote to newNoteMarker --- app/assets/javascripts/index/new_note.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/index/new_note.js b/app/assets/javascripts/index/new_note.js index 887ba043b..e3a6b4c80 100644 --- a/app/assets/javascripts/index/new_note.js +++ b/app/assets/javascripts/index/new_note.js @@ -5,7 +5,7 @@ OSM.NewNote = function (map) { content = $("#sidebar_content"), page = {}, addNoteButton = $(".control-note .control-button"), - newNote, + newNoteMarker, halo; var noteIcons = { @@ -60,7 +60,7 @@ OSM.NewNote = function (map) { function noteCreated(feature, marker) { content.find("textarea").val(""); updateMarker(feature); - newNote = null; + newNoteMarker = null; noteLayer.removeLayer(marker); addNoteButton.removeClass("active"); OSM.router.route("/note/" + feature.properties.id); @@ -124,20 +124,20 @@ OSM.NewNote = function (map) { padding: [50, 50] }); - newNote = L.marker(markerLatlng, { + newNoteMarker = L.marker(markerLatlng, { icon: noteIcons.new, opacity: 0.9, draggable: true }); - newNote.on("dragstart dragend", function (a) { - newHalo(newNote.getLatLng(), a.type); + newNoteMarker.on("dragstart dragend", function (a) { + newHalo(newNoteMarker.getLatLng(), a.type); }); - newNote.addTo(noteLayer); - newHalo(newNote.getLatLng()); + newNoteMarker.addTo(noteLayer); + newHalo(newNoteMarker.getLatLng()); - newNote.on("remove", function () { + newNoteMarker.on("remove", function () { addNoteButton.removeClass("active"); }).on("dragend", function () { content.find("textarea").focus(); @@ -153,14 +153,14 @@ OSM.NewNote = function (map) { content.find("input[type=submit]").on("click", function (e) { e.preventDefault(); - createNote(newNote, e.target.form, "/api/0.6/notes.json"); + createNote(newNoteMarker, e.target.form, "/api/0.6/notes.json"); }); return map.getState(); }; page.unload = function () { - if (newNote) noteLayer.removeLayer(newNote); + if (newNoteMarker) noteLayer.removeLayer(newNoteMarker); if (halo) map.removeLayer(halo); addNoteButton.removeClass("active"); }; -- 2.39.5