From 05bba38d862dc6b6d27c38fb9f2318a5b6f0fdab Mon Sep 17 00:00:00 2001 From: Rich Lott / Artful Robot Date: Thu, 12 Aug 2021 07:56:47 +0100 Subject: [PATCH] Reinstate jQueryUI visible focus effect in quicksearch user-interface issue 37 --- js/crm.menubar.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/crm.menubar.js b/js/crm.menubar.js index a9177bb5b2..c75e38c5e5 100644 --- a/js/crm.menubar.js +++ b/js/crm.menubar.js @@ -314,6 +314,12 @@ }); }, focus: function (event, ui) { + // This is when an item is 'focussed' by keyboard up/down or mouse hover. + // It is not the same as actually having focus, i.e. it is not :focus + var lis = $(event.currentTarget).find('li[data-cid="' + ui.item.value + '"]'); + lis.children('div').addClass('ui-state-active'); + lis.siblings().children('div').removeClass('ui-state-active'); + // Returning false leaves the user-entered text as it was. return false; }, select: function (event, ui) { @@ -340,6 +346,7 @@ .autocomplete( "instance" )._renderItem = function( ul, item ) { var uiMenuItemWrapper = $("
"); if (item.value == 0) { + // "No results" uiMenuItemWrapper.text(item.label); } else { @@ -359,7 +366,7 @@ })); } - return $( "
  • " ) + return $( "
  • " ) .append(uiMenuItemWrapper) .appendTo( ul ); }; -- 2.25.1