Skip to content

Commit

Permalink
Focus on current project selection
Browse files Browse the repository at this point in the history
To follow the expected behaviour of a standard dropdown selection list,
make the list to be scrolled and focused on the currently selected
project.

Fixes: #23248
  • Loading branch information
cproensa authored and dregad committed Sep 9, 2017
1 parent 384f6cc commit 5d0c942
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/layout_api.php
Expand Up @@ -531,7 +531,7 @@ function layout_navbar_projects_menu() {
}

if( $t_show_project_selector ) {
echo '<li class="grey">' . "\n";
echo '<li class="grey" id="dropdown_projects_menu">' . "\n";
echo '<a data-toggle="dropdown" href="#" class="dropdown-toggle">' . "\n";

$t_current_project_id = helper_get_current_project();
Expand Down
4 changes: 4 additions & 0 deletions js/common.js
Expand Up @@ -374,6 +374,10 @@ $(document).ready( function() {
$('tr[id=bugnote-attach-files]').show();
}
});

$(document).on('shown.bs.dropdown', '#dropdown_projects_menu', function() {
$(this).find(".dropdown-menu li.active a").focus();
});
});

function setBugLabel() {
Expand Down

0 comments on commit 5d0c942

Please sign in to comment.