From fa0c12cdcd154a048f96a1934fc593ff9d509fe3 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Tue, 31 Dec 2024 23:02:47 +0300 Subject: [PATCH] Disable new note submit button in click handler --- app/assets/javascripts/index/new_note.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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"); }); -- 2.39.5