]> git.openstreetmap.org Git - rails.git/commitdiff
Disable new note submit button in click handler
authorAnton Khorev <tony29@yandex.ru>
Tue, 31 Dec 2024 20:02:47 +0000 (23:02 +0300)
committerAnton Khorev <tony29@yandex.ru>
Tue, 31 Dec 2024 20:02:47 +0000 (23:02 +0300)
app/assets/javascripts/index/new_note.js

index e3a6b4c80acf743d83ce7d56100f009737092bde..7a82c5bc69512f362425e1663b4744c414dc576b 100644 (file)
@@ -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");
     });