Skip to content

Commit

Permalink
js: move current string in nearbystrings to view
Browse files Browse the repository at this point in the history
Fixes #10946
  • Loading branch information
nijel committed Feb 9, 2024
1 parent fd9b857 commit c81c52c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions weblate/static/loader-bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,15 @@ $(function () {
},
});

/* Move current translation into the view */
$('a[data-toggle="tab"][href="#nearby"]').on("shown.bs.tab", function (e) {
document.querySelector("#nearby .current_translation").scrollIntoView({
block: "nearest",
inline: "nearest",
behavior: "smooth",
});
});

document.querySelectorAll("[data-visibility]").forEach((toggle) => {
toggle.addEventListener("click", (event) => {
document
Expand Down

0 comments on commit c81c52c

Please sign in to comment.