Query term in tags function in select2 3.4 #2141
This commit is contained in:
parent
79e031fbdf
commit
42f2acd0aa
19
select2.js
19
select2.js
@ -538,14 +538,17 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
var isFunc = $.isFunction(data);
|
var isFunc = $.isFunction(data);
|
||||||
return function (query) {
|
return function (query) {
|
||||||
var t = query.term, filtered = {results: []};
|
var t = query.term, filtered = {results: []};
|
||||||
$(isFunc ? data() : data).each(function () {
|
var result = $(isFunc ? data(query) : data);
|
||||||
var isObject = this.text !== undefined,
|
if ($.isArray(result)) {
|
||||||
text = isObject ? this.text : this;
|
$(isFunc ? data() : data).each(function () {
|
||||||
if (t === "" || query.matcher(t, text)) {
|
var isObject = this.text !== undefined,
|
||||||
filtered.results.push(isObject ? this : {id: this, text: this});
|
text = isObject ? this.text : this;
|
||||||
}
|
if (t === "" || query.matcher(t, text)) {
|
||||||
});
|
filtered.results.push(isObject ? this : {id: this, text: this});
|
||||||
query.callback(filtered);
|
}
|
||||||
|
});
|
||||||
|
query.callback(filtered);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user