+ var form = e.target.form;
+
+ $(form).find("button[type=submit]").prop("disabled", true);
+
+ $.ajax({
+ url: data.url,
+ type: data.method,
+ oauth: true,
+ data: { text: $(form.text).val() },
+ success: function () {
+ OSM.loadSidebarContent(path, function () {
+ initialize(path, id);
+ moveToNote();
+ });
+ },
+ error: function (xhr) {
+ $(form).find("#comment-error")
+ .text(xhr.responseText)
+ .prop("hidden", false);
+ updateButtons(form);
+ }
+ });