Skip to content

Commit

Permalink
Render suggestion snippet properly
Browse files Browse the repository at this point in the history
To render the snippets properly, we need to use the _renderItem property
of the autocomple ui.
  • Loading branch information
maneeshpm committed May 10, 2021
1 parent 95e976b commit 9bba054
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions static/skin/taskbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ jq(document).ready(() => {
$( "#kiwixsearchform" ).submit();
}
},
});
}).data( "ui-autocomplete" )._renderItem = function( ul, item ) {
return $( "<li>" )
.data( "ui-autocomplete-item", item )
.append( item.label )
.appendTo( ul );
};

/* cybook hack */
if (navigator.userAgent.indexOf("bookeen/cybook") != -1) {
Expand Down Expand Up @@ -85,4 +90,4 @@ jq(document).ready(() => {
}
});
})(jq);
})
})

0 comments on commit 9bba054

Please sign in to comment.