1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Prevent matching HTML line breaks

This commit is contained in:
Hillel Coren 2017-04-12 17:32:40 +03:00
parent f696c97e06
commit aecc1bee3e
4 changed files with 22 additions and 14 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

@ -454,6 +454,14 @@ function comboboxHighlighter(item) {
})
}
function comboboxMatcher(item) {
// http://stackoverflow.com/a/5002618/497368
var div = document.createElement("div");
div.innerHTML = item;
var text = div.textContent || div.innerText || '';
return ~text.toLowerCase().indexOf(this.query.toLowerCase());
}
function getContactDisplayName(contact)
{
if (contact.first_name || contact.last_name) {

View File

@ -103,7 +103,7 @@
{!! Former::select('client')
->addOption('', '')
->data_bind("dropdown: client, dropdownOptions: {highlighter: comboboxHighlighter}")
->data_bind("dropdown: client, dropdownOptions: {highlighter: comboboxHighlighter, matcher: comboboxMatcher}")
->addClass('client-input')
->addGroupClass('client_select closer-row') !!}