Commit 6337f961 authored by yuripc's avatar yuripc

fix filterBehavior both

parent bc9a8f2b
......@@ -608,6 +608,17 @@
if (this.query !== event.target.value) {
this.query = event.target.value;
var filterCandidate = '';
if ((this.options.filterBehavior === 'text')) {
filterCandidate = text;
}
else if ((this.options.filterBehavior === 'value')) {
filterCandidate = value;
}
else if (this.options.filterBehavior === 'both') {
filterCandidate = text + '\n' + value;
}
$.each($('li', this.$ul), $.proxy(function(index, element) {
var value = $('input', element).val();
var text = $('label', element).text();
......@@ -617,14 +628,6 @@
// interesting for this search
var showElement = false;
var filterCandidate = '';
if ((this.options.filterBehavior === 'text' || this.options.filterBehavior === 'both')) {
filterCandidate = text;
}
if ((this.options.filterBehavior === 'value' || this.options.filterBehavior === 'both')) {
filterCandidate = value;
}
if (this.options.enableCaseInsensitiveFiltering && filterCandidate.toLowerCase().indexOf(this.query.toLowerCase()) > -1) {
showElement = true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment