From: Anton Khorev Date: Tue, 31 Dec 2024 20:02:47 +0000 (+0300) Subject: Disable new note submit button in click handler X-Git-Tag: live~106^2~15 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/fa0c12cdcd154a048f96a1934fc593ff9d509fe3?ds=sidebyside Disable new note submit button in click handler --- diff --git a/app/assets/javascripts/index/new_note.js b/app/assets/javascripts/index/new_note.js index e3a6b4c80..7a82c5bc6 100644 --- a/app/assets/javascripts/index/new_note.js +++ b/app/assets/javascripts/index/new_note.js @@ -41,8 +41,6 @@ OSM.NewNote = function (map) { marker.options.draggable = false; marker.dragging.disable(); - $(form).find("input[type=submit]").prop("disabled", true); - $.ajax({ url: url, type: "POST", @@ -153,6 +151,7 @@ OSM.NewNote = function (map) { content.find("input[type=submit]").on("click", function (e) { e.preventDefault(); + $(this).prop("disabled", true); createNote(newNoteMarker, e.target.form, "/api/0.6/notes.json"); });