From: Anton Khorev Date: Mon, 8 Jan 2024 14:53:50 +0000 (+0300) Subject: Scroll to api error message X-Git-Tag: live~786^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/2d03d738dab3ffa1f73566fd85d6f4a8c92f6d56 Scroll to api error message --- diff --git a/app/assets/javascripts/index/changeset.js b/app/assets/javascripts/index/changeset.js index 40f6aa05b..75a1f7b4d 100644 --- a/app/assets/javascripts/index/changeset.js +++ b/app/assets/javascripts/index/changeset.js @@ -47,9 +47,11 @@ OSM.Changeset = function (map) { 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" }); } }); }