Ignore:
Timestamp:
08/03/11 17:40:31 (13 years ago)
Author:
brunocosta
Message:

Ticket #2162 - Evitando buscas no arquivamento local quando se pagina e não existem resultados locais.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/expressoMail1_2/js/search.js

    r4847 r4900  
    1616                this.txtfields          = new Array("txt_ass","txt_de","txt_body","txt_para","txt_cc","txt_cco", "since_date", "before_date", "on_date"); 
    1717                this.selectFields       = new Array("flagged", "seen", "answered", "recent"); 
     18                this.localResults   = 0; 
    1819        } 
    1920 
     
    226227 
    227228        // Gears - local 
    228                 if ( preferences.use_local_messages == 1 ) 
     229                if (preferences.use_local_messages == 1 && EsearchE.localResults != 0) 
    229230                { 
    230231                        temp = expresso_local_messages.list_local_folders(); 
     
    233234                                local_folders.push(temp[x][0]); 
    234235                        } 
    235                 } 
    236                  
    237                 if ( local_folders.length > 0 ) 
     236                    if ( local_folders.length > 0 ) 
    238237                        _gears = expresso_local_messages.search( local_folders, expresso_local_messages.getFilter() ); 
     238                        _data['gears_num_msgs'] = _gears.length; 
     239                }else{ 
     240                    _data['gears_num_msgs']     = 0; 
     241                } 
    239242 
    240243                _data['data']                   = data['data']; 
    241244                _data['num_msgs']               = data['num_msgs']; 
    242                 _data['gears_num_msgs'] = _gears.length; 
     245                 
    243246 
    244247                delete_border( data['currentTab'], false); 
     
    393396            if (gears.length > 0) 
    394397            { 
     398                this.localResults = gears.length; 
    395399                allMsg['data_gears']                    = gears; 
     400            }else{ 
     401                 this.localResults = 0; 
    396402            } 
    397403                 
     
    12341240                } 
    12351241                var count = data['num_msgs'] ?  data['num_msgs'] : tmp.length > 0 ? tmp.length : "0"; 
    1236  
     1242                 EsearchE.localResults = tmp.length; 
    12371243                if( data['num_msgs'] ) 
    12381244                { 
     
    12561262                        allMsg['data_gears'] = tmp; 
    12571263                    } 
    1258  
    1259                     write_msg( count + " " + get_lang("results found") ); 
     1264                    
     1265                     write_msg( count + " " + get_lang("results found") ); 
    12601266                    EsearchE.mount_result( allMsg, 'SORTDATE' ); 
    12611267                } 
     1268 
    12621269            } 
    12631270 
Note: See TracChangeset for help on using the changeset viewer.