Render suggestion snippet properly

To render the snippets properly, we need to use the _renderItem property
of the autocomple ui.
This commit is contained in:
Maneesh P M 2021-05-10 12:51:01 +05:30 committed by Matthieu Gautier
parent 56434de79e
commit 3288cd80e5
1 changed files with 6 additions and 1 deletions

View File

@ -34,7 +34,12 @@ jq(document).ready(() => {
$( "#kiwixsearchform" ).submit(); $( "#kiwixsearchform" ).submit();
} }
}, },
}); }).data( "ui-autocomplete" )._renderItem = function( ul, item ) {
return $( "<li>" )
.data( "ui-autocomplete-item", item )
.append( item.label )
.appendTo( ul );
};
/* cybook hack */ /* cybook hack */
if (navigator.userAgent.indexOf("bookeen/cybook") != -1) { if (navigator.userAgent.indexOf("bookeen/cybook") != -1) {