X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/89fc5a7fdc07e8aa36c203c1ad1792b03467d44e..78f608b114c05f1147936a57b930831e28000c1a:/app/assets/javascripts/index/notes.js.erb?ds=sidebyside diff --git a/app/assets/javascripts/index/notes.js.erb b/app/assets/javascripts/index/notes.js.erb index 779ae1ab0..5ecaca7dd 100644 --- a/app/assets/javascripts/index/notes.js.erb +++ b/app/assets/javascripts/index/notes.js.erb @@ -20,18 +20,19 @@ $(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); - feature.attributes.status = "open"; - feature.attributes.id = data; + feature.attributes = data.properties; map.noteLayer.drawFeature(feature); @@ -43,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: {