Fix for client autocomplete

This commit is contained in:
Hillel Coren 2017-04-13 10:08:09 +03:00
parent 0477f2e77d
commit 9eaa8c94bd
3 changed files with 9 additions and 9 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

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