- var changesets = [];
- $("[data-changeset]").each(function () {
- var changeset = $(this).data('changeset');
- if (changeset.bbox) {
- changeset.bounds = L.latLngBounds([changeset.bbox.minlat, changeset.bbox.minlon],
- [changeset.bbox.maxlat, changeset.bbox.maxlon]);
- changesets.push(changeset);
+ if (include_data) {
+ data = { text: content.find("textarea").val() };
+ } else {
+ data = {};
+ }
+
+ $.ajax({
+ url: url,
+ type: method,
+ oauth: true,
+ data: data,
+ success: function () {
+ OSM.loadSidebarContent(window.location.pathname, page.load);
+ },
+ error: function (xhr) {
+ content.find("button[data-method][data-url]").prop("disabled", false);
+ content.find("#comment-error")
+ .text(xhr.responseText)
+ .prop("hidden", false)
+ .get(0).scrollIntoView({ block: "nearest" });