page.load = function (path, id) {
if (id) currentChangesetId = id;
initialize();
- addChangeset(currentChangesetId, true);
+ addChangeset(currentChangesetId);
};
- function addChangeset(id, center) {
+ function addChangeset(id) {
map.addObject({ type: "changeset", id: parseInt(id, 10) }, function (bounds) {
- if (!window.location.hash && bounds.isValid() &&
- (center || !map.getBounds().contains(bounds))) {
+ if (!window.location.hash && bounds.isValid()) {
OSM.router.withoutMoveListener(function () {
map.fitBounds(bounds);
});
OSM.loadSidebarContent(window.location.pathname, page.load);
},
error: function (xhr) {
- content.find("#comment-error").text(xhr.responseText);
- content.find("#comment-error").prop("hidden", false);
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" });
}
});
}