Skip to content

Commit

Permalink
IBX-4064: Search adjustements (#2566)
Browse files Browse the repository at this point in the history
* custom.js: "See all results" → "See more results"
* custom.js: No search result highlight on keyboard navigation

(cherry picked from commit 33fc6d9)
  • Loading branch information
adriendupuis committed Dec 5, 2024
1 parent 95b7491 commit 9d68a72
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ $(document).ready(function() {
let link = $('.ds-dropdown-menu a.search-page-link');
if (!link.length) {
$('.ds-dropdown-menu').append(`<div class="search-page-link-wrapper">
<a class="search-page-link" href="">See all results</a>
<a class="search-page-link" href="">See more results</a>
</div>`);
link = $('.ds-dropdown-menu a.search-page-link');
}
Expand All @@ -142,6 +142,7 @@ $(document).ready(function() {
debug: false,
});
search.autocomplete.on('autocomplete:updated', event => {
$('.ds-cursor').removeClass('ds-cursor');
const searchedText = $('#search_input')[0].value.trim();
const separatorText = '›';
const separatorClass = 'aa-suggestion-title-separator';
Expand All @@ -168,8 +169,9 @@ $(document).ready(function() {
});

$(document).on('keydown keypress', 'form.md-search__form', function(event) {
if (event.keyCode == 13) {
if (-1 != $.inArray(event.key, ['Enter', 'ArrowDown', 'ArrowUp'])) {
event.preventDefault();
$('.ds-cursor').removeClass('ds-cursor');

return false;
}
Expand Down

0 comments on commit 9d68a72

Please sign in to comment.