From 02e9932f1e367b7ba08480fabd77682a46fe94d8 Mon Sep 17 00:00:00 2001 From: luxick Date: Mon, 9 Feb 2026 09:57:26 +0100 Subject: [PATCH] Serach enhancement refinement --- css/_search.less | 4 ++++ css/design.less | 2 +- images/search.png | Bin 307 -> 0 bytes script.js | 17 ++++++++++++----- 4 files changed, 17 insertions(+), 6 deletions(-) delete mode 100755 images/search.png diff --git a/css/_search.less b/css/_search.less index eaf1481..848f8ae 100755 --- a/css/_search.less +++ b/css/_search.less @@ -211,6 +211,10 @@ outline: none; } + ul.search-suggestions li.is-tabbed > a { + box-shadow: inset 0 0 0 1px @ini_border; + } + ul.search-suggestions li.is-loading, ul.search-suggestions li.is-empty { padding: .15em .25em; diff --git a/css/design.less b/css/design.less index e295327..42f468f 100755 --- a/css/design.less +++ b/css/design.less @@ -143,7 +143,7 @@ form.search { } button { - background: transparent url(images/search.png) no-repeat 0 0; + background: transparent no-repeat 0 0; border-width: 0; width: 19px; height: 14px; diff --git a/images/search.png b/images/search.png deleted file mode 100755 index a07a721df97082deaa8365aeb7a346f8ac459d6c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 307 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh3?wzC-F*zCk^_7~T!A#LL0U%1J)j+mB|(0{ z>?V#XK6YZZfx6n}JkG%me(n|_L2fdJis~*_uKIeR49-l3Y(T|vo-U3d6^y#aL;08j z8IE2!cvo`zy}#=xne6#zvb@Vw^CYLmH?O+Nb@2s1i<5jV-Oo&Mm7Oj5^qAz= items.length) { clearActive(); @@ -209,13 +211,17 @@ jQuery(function(){ var $active = $options.filter('[data-index="' + activeIndex + '"]'); $active.addClass('is-active').attr('aria-selected', 'true'); + if (lastNavigation === 'tab') { + $active.addClass('is-tabbed'); + } $input.attr('aria-activedescendant', $active.attr('id')); } - function moveActive(delta) { + function moveActive(delta, source) { if (!items.length) { return; } + lastNavigation = source || null; if (activeIndex < 0) { activeIndex = delta > 0 ? 0 : items.length - 1; } else { @@ -349,19 +355,19 @@ jQuery(function(){ if (key === 'ArrowDown') { event.preventDefault(); - moveActive(1); + moveActive(1, 'arrow'); return; } if (key === 'ArrowUp') { event.preventDefault(); - moveActive(-1); + moveActive(-1, 'arrow'); return; } if (key === 'Tab') { event.preventDefault(); - moveActive(event.shiftKey ? -1 : 1); + moveActive(event.shiftKey ? -1 : 1, 'tab'); return; } @@ -374,6 +380,7 @@ jQuery(function(){ $output.on('mouseenter', 'li[data-index]', function () { activeIndex = parseInt(jQuery(this).attr('data-index'), 10); + lastNavigation = 'mouse'; updateActive(); });