1
0
mirror of synced 2025-03-10 22:56:12 +03:00

fix bug where tagging was broken if strings instead of objects were used

This commit is contained in:
Igor Vaynberg 2012-05-02 08:39:55 -07:00
parent e0f854d667
commit 2aeb3d5bd5

View File

@ -297,7 +297,7 @@
return function (query) {
var t = query.term.toUpperCase(), filtered = {results: []};
$(data).each(function () {
var isObject = "text" in this,
var isObject = this.text!==undefined,
text = isObject ? this.text : this;
if (t === "" || text.toUpperCase().indexOf(t) >= 0) {
filtered.results.push(isObject ? this : {id: this, text: this});