From 3288cd80e56a8f5545bf825eb3f5c8553526556e Mon Sep 17 00:00:00 2001 From: Maneesh P M Date: Mon, 10 May 2021 12:51:01 +0530 Subject: [PATCH] Render suggestion snippet properly To render the snippets properly, we need to use the _renderItem property of the autocomple ui. --- static/skin/taskbar.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/skin/taskbar.js b/static/skin/taskbar.js index df91cfad..d2d26fb8 100644 --- a/static/skin/taskbar.js +++ b/static/skin/taskbar.js @@ -34,7 +34,12 @@ jq(document).ready(() => { $( "#kiwixsearchform" ).submit(); } }, - }); + }).data( "ui-autocomplete" )._renderItem = function( ul, item ) { + return $( "
  • " ) + .data( "ui-autocomplete-item", item ) + .append( item.label ) + .appendTo( ul ); + }; /* cybook hack */ if (navigator.userAgent.indexOf("bookeen/cybook") != -1) {