1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Fix client auto-complete search highlighting

This commit is contained in:
Hillel Coren 2017-05-25 20:58:15 +03:00
parent b87afa8dc4
commit 48ec94ce39
3 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -450,10 +450,10 @@ if (window.ko) {
function comboboxHighlighter(item) {
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
var result = item.replace(new RegExp('<br/>', 'g'), "\n");
result = stripHtmlTags(result);
result = result.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
return match ? '<strong>' + match + '</strong>' : query;
});
result = stripHtmlTags(result);
return result.replace(new RegExp("\n", 'g'), '<br/>');
}