X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/513bec8044e56bf669d1b2e7ef3a1c4b53362aff..7599f98957334d1924550205f7ba12a726de7eb0:/app/assets/javascripts/index/notes.js.erb diff --git a/app/assets/javascripts/index/notes.js.erb b/app/assets/javascripts/index/notes.js.erb index 9c7d00176..5ecaca7dd 100644 --- a/app/assets/javascripts/index/notes.js.erb +++ b/app/assets/javascripts/index/notes.js.erb @@ -20,12 +20,14 @@ $(document).ready(function () { function createNote(feature, form) { var location = unproj(feature.geometry.getBounds().getCenterLonLat()); + $(form).find("input[type=submit]").prop("disabled", true); + $.ajax($("#createnoteanchor").attr("href"), { type: "POST", data: { lon: location.lon, lat: location.lat, - text: $(form.comment).val() + text: $(form.text).val() }, success: function (data) { map.noteSelector.unselect(feature); @@ -42,6 +44,8 @@ $(document).ready(function () { function updateNote(feature, form, close) { var url = close ? feature.attributes.close_url : feature.attributes.comment_url; + $(form).find("input[type=submit]").prop("disabled", true); + $.ajax(url, { type: "POST", data: {