From: Tom Hughes Date: Tue, 16 Oct 2012 11:23:27 +0000 (+0100) Subject: Disable buttons while form submission is in progress X-Git-Tag: live~5096^2~73 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/c0ee3f65bb9cd81f39c13417be5a2e37cba05921 Disable buttons while form submission is in progress --- diff --git a/app/assets/javascripts/index/notes.js.erb b/app/assets/javascripts/index/notes.js.erb index 8b440910c..5ecaca7dd 100644 --- a/app/assets/javascripts/index/notes.js.erb +++ b/app/assets/javascripts/index/notes.js.erb @@ -20,6 +20,8 @@ $(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: { @@ -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: {