Skip to content

Commit

Permalink
Merge pull request #13686 from saraycp/focus-selected-action
Browse files Browse the repository at this point in the history
Scroll towards the current action in the dropdown
  • Loading branch information
Dany Marcoux committed Jan 17, 2023
2 parents b3c41c6 + 27c043b commit ace75a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api/app/views/webui/request/_actions_details.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
var hashRegexp = new RegExp(`\#${HASH_PREFIX}.+`);

$('#request-actions').on('shown.bs.dropdown', function () {
// Scrolls towards the current request action
var currentAction = $('a.dropdown-item.active');
currentAction[0].scrollIntoView({behavior: "smooth", block: "center"});

// Adapts Href according to seleted tab
$.each($('#request-actions .dropdown-item'), function () {
var href = $(this).attr('href');
if (document.location.hash.search('#diff_') != -1 && href.search('#') == -1) {
Expand Down

0 comments on commit ace75a3

Please sign in to comment.