|
|
@ -3615,7 +3615,8 @@ function rcube_webmail()
|
|
|
|
var cpos = this.get_caret_pos(this.ksearch_input),
|
|
|
|
var cpos = this.get_caret_pos(this.ksearch_input),
|
|
|
|
p = inp_value.lastIndexOf(',', cpos-1),
|
|
|
|
p = inp_value.lastIndexOf(',', cpos-1),
|
|
|
|
q = inp_value.substring(p+1, cpos),
|
|
|
|
q = inp_value.substring(p+1, cpos),
|
|
|
|
min = this.env.autocomplete_min_length;
|
|
|
|
min = this.env.autocomplete_min_length,
|
|
|
|
|
|
|
|
ac = this.ksearch_data;
|
|
|
|
|
|
|
|
|
|
|
|
// trim query string
|
|
|
|
// trim query string
|
|
|
|
q = $.trim(q);
|
|
|
|
q = $.trim(q);
|
|
|
@ -3641,8 +3642,8 @@ function rcube_webmail()
|
|
|
|
if (!q.length)
|
|
|
|
if (!q.length)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
// ...new search value contains old one and previous search result was empty
|
|
|
|
// ...new search value contains old one and previous search was not finished or its result was empty
|
|
|
|
if (old_value && old_value.length && this.env.contacts && !this.env.contacts.length && q.indexOf(old_value) == 0)
|
|
|
|
if (old_value && old_value.length && q.indexOf(old_value) == 0 && (!ac || !ac.num) && this.env.contacts && !this.env.contacts.length)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
var i, lock, source, xhr, reqid = new Date().getTime(),
|
|
|
|
var i, lock, source, xhr, reqid = new Date().getTime(),
|
|
|
@ -3650,7 +3651,8 @@ function rcube_webmail()
|
|
|
|
sources = props && props.sources ? props.sources : [],
|
|
|
|
sources = props && props.sources ? props.sources : [],
|
|
|
|
action = props && props.action ? props.action : 'mail/autocomplete';
|
|
|
|
action = props && props.action ? props.action : 'mail/autocomplete';
|
|
|
|
|
|
|
|
|
|
|
|
this.ksearch_data = {id: reqid, sources: sources.slice(), action: action, locks: [], requests: []};
|
|
|
|
this.ksearch_data = {id: reqid, sources: sources.slice(), action: action,
|
|
|
|
|
|
|
|
locks: [], requests: [], num: sources.length};
|
|
|
|
|
|
|
|
|
|
|
|
for (i=0; i<threads; i++) {
|
|
|
|
for (i=0; i<threads; i++) {
|
|
|
|
source = this.ksearch_data.sources.shift();
|
|
|
|
source = this.ksearch_data.sources.shift();
|
|
|
@ -3735,6 +3737,7 @@ function rcube_webmail()
|
|
|
|
|
|
|
|
|
|
|
|
// run next parallel search
|
|
|
|
// run next parallel search
|
|
|
|
if (data.id == reqid) {
|
|
|
|
if (data.id == reqid) {
|
|
|
|
|
|
|
|
data.num--;
|
|
|
|
if (maxlen > 0 && data.sources.length) {
|
|
|
|
if (maxlen > 0 && data.sources.length) {
|
|
|
|
var lock, xhr, source = data.sources.shift();
|
|
|
|
var lock, xhr, source = data.sources.shift();
|
|
|
|
if (source) {
|
|
|
|
if (source) {
|
|
|
|