From b7d08b58cde78cb20094094e2cbcd195ce91dd0d Mon Sep 17 00:00:00 2001 From: "Will \"Coke\" Coleda" Date: Tue, 4 Jul 2017 20:44:10 -0400 Subject: [PATCH] Highlight the matched porton of the search Fixed #1409 --- template/search_template.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/template/search_template.js b/template/search_template.js index 5e8f2c761..77c7530b6 100644 --- a/template/search_template.js +++ b/template/search_template.js @@ -6,6 +6,13 @@ $(function(){ this._super(); this.widget().menu( "option", "items", "> :not(.ui-autocomplete-category)" ); }, + _renderItem: function( ul, item) { + var regex = new RegExp('(' + current_search + ')', 'ig'); + var text = item.label.replace(regex, '$1'); + return $( "
  • " ) + .append( $( "
    " ).html(text) ) + .appendTo( ul ); + }, _renderMenu: function( ul, items ) { var that = this, currentCategory = "";