mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
Enhancement to r45442 so search options provided as a list are still filtered, but server response is accepted unfiltered.
Fixes search options provided as a static list were not being filtered.
This commit is contained in:
parent
4f2f64fcbe
commit
62686e4b2a
@ -1089,13 +1089,14 @@
|
||||
filtered = [],
|
||||
newSuggestions = [],
|
||||
selectedValues = ms.getValue();
|
||||
var server_search = typeof cfg.data == 'string' && cfg.data.indexOf(',') < 0
|
||||
// filter the data according to given input
|
||||
if(q.length > 0) {
|
||||
$.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.strictSuggest === false) {
|
||||
cfg.strictSuggest === false && server_search) {
|
||||
if(cfg.strictSuggest === false || name.toLowerCase().indexOf(q.toLowerCase()) === 0) {
|
||||
filtered.push(obj);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user