mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 05:34:30 -04:00
Fix for invoice client autocomplete
This commit is contained in:
parent
9f52dc7fe6
commit
a088aa3e00
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -449,17 +449,23 @@ if (window.ko) {
|
|||||||
|
|
||||||
function comboboxHighlighter(item) {
|
function comboboxHighlighter(item) {
|
||||||
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
|
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
|
||||||
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
|
var result = item.replace('<br/>', "\n");
|
||||||
|
result = result.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
|
||||||
return match ? '<strong>' + match + '</strong>' : query;
|
return match ? '<strong>' + match + '</strong>' : query;
|
||||||
})
|
});
|
||||||
|
result = result.replace("\n", '<br/>');
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function comboboxMatcher(item) {
|
function comboboxMatcher(item) {
|
||||||
|
return ~stripHtmlTags(item).toLowerCase().indexOf(this.query.toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
function stripHtmlTags(text) {
|
||||||
// http://stackoverflow.com/a/5002618/497368
|
// http://stackoverflow.com/a/5002618/497368
|
||||||
var div = document.createElement("div");
|
var div = document.createElement("div");
|
||||||
div.innerHTML = item;
|
div.innerHTML = text;
|
||||||
var text = div.textContent || div.innerText || '';
|
return div.textContent || div.innerText || '';
|
||||||
return ~text.toLowerCase().indexOf(this.query.toLowerCase());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getContactDisplayName(contact)
|
function getContactDisplayName(contact)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user