Don't require literal search text to be in results - if server returns it, present it to user

This commit is contained in:
Nathan Gray 2014-01-29 17:32:32 +00:00
parent 4036b268c9
commit 5f4f8f99fd

View File

@ -1094,7 +1094,8 @@
$.each(data, function(index, obj) {
var name = obj[cfg.displayField];
if((cfg.matchCase === true && name.indexOf(q) > -1) ||
(cfg.matchCase === false && name.toLowerCase().indexOf(q.toLowerCase()) > -1)) {
(cfg.matchCase === false && name.toLowerCase().indexOf(q.toLowerCase()) > -1) ||
cfg.strictSuggest === false) {
if(cfg.strictSuggest === false || name.toLowerCase().indexOf(q.toLowerCase()) === 0) {
filtered.push(obj);
}