]> git.openstreetmap.org Git - rails.git/commitdiff
Scroll to api error message
authorAnton Khorev <tony29@yandex.ru>
Mon, 8 Jan 2024 14:53:50 +0000 (17:53 +0300)
committerAnton Khorev <tony29@yandex.ru>
Sun, 11 Feb 2024 22:27:12 +0000 (01:27 +0300)
app/assets/javascripts/index/changeset.js

index 40f6aa05b2dbbe8ac60e5a0bcbcc09773576d58a..75a1f7b4dfa770463867cf7fafafbaf05babb1e3 100644 (file)
@@ -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" });
       }
     });
   }