Disable new note submit button in click handler

This commit is contained in:
Anton Khorev 2024-12-31 23:02:47 +03:00
parent c4709e2a05
commit fa0c12cdcd

View file

@ -41,8 +41,6 @@ OSM.NewNote = function (map) {
marker.options.draggable = false; marker.options.draggable = false;
marker.dragging.disable(); marker.dragging.disable();
$(form).find("input[type=submit]").prop("disabled", true);
$.ajax({ $.ajax({
url: url, url: url,
type: "POST", type: "POST",
@ -153,6 +151,7 @@ OSM.NewNote = function (map) {
content.find("input[type=submit]").on("click", function (e) { content.find("input[type=submit]").on("click", function (e) {
e.preventDefault(); e.preventDefault();
$(this).prop("disabled", true);
createNote(newNoteMarker, e.target.form, "/api/0.6/notes.json"); createNote(newNoteMarker, e.target.form, "/api/0.6/notes.json");
}); });