Changeset 5273 in subversion


Ignore:
Timestamp:
Sep 23, 2011 3:48:21 AM (20 months ago)
Author:
alec
Message:
  • Fix check if new search value contains old one and previous search was empty in autocomplete
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/js/app.js

    r5268 r5273  
    36163616      p = inp_value.lastIndexOf(',', cpos-1), 
    36173617      q = inp_value.substring(p+1, cpos), 
    3618       min = this.env.autocomplete_min_length; 
     3618      min = this.env.autocomplete_min_length, 
     3619      ac = this.ksearch_data; 
    36193620 
    36203621    // trim query string 
     
    36423643      return; 
    36433644 
    3644     // ...new search value contains old one and previous search result was empty 
    3645     if (old_value && old_value.length && this.env.contacts && !this.env.contacts.length && q.indexOf(old_value) == 0) 
     3645    // ...new search value contains old one and previous search was not finished or its result was empty 
     3646    if (old_value && old_value.length && q.indexOf(old_value) == 0 && (!ac || !ac.num) && this.env.contacts && !this.env.contacts.length) 
    36463647      return; 
    36473648 
     
    36513652      action = props && props.action ? props.action : 'mail/autocomplete'; 
    36523653 
    3653     this.ksearch_data = {id: reqid, sources: sources.slice(), action: action, locks: [], requests: []}; 
     3654    this.ksearch_data = {id: reqid, sources: sources.slice(), action: action, 
     3655      locks: [], requests: [], num: sources.length}; 
    36543656 
    36553657    for (i=0; i<threads; i++) { 
     
    37363738    // run next parallel search 
    37373739    if (data.id == reqid) { 
     3740      data.num--; 
    37383741      if (maxlen > 0 && data.sources.length) { 
    37393742        var lock, xhr, source = data.sources.shift(); 
Note: See TracChangeset for help on using the changeset viewer.