diff options
Diffstat (limited to 'program/js/app.js')
-rw-r--r-- | program/js/app.js | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/program/js/app.js b/program/js/app.js index 32d7a6332..db79772a1 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3332,31 +3332,33 @@ function rcube_webmail() this.qsearch = function(value) { if (value != '') { - var addurl = ''; + var n, addurl = '', mods_arr = [], + mods = this.env.search_mods, + mbox = this.env.mailbox, + lock = this.set_busy(true, 'searching'); + if (this.message_list) { this.clear_message_list(); - if (this.env.search_mods) { - var mods = this.env.search_mods[this.env.mailbox] ? this.env.search_mods[this.env.mailbox] : this.env.search_mods['*']; - if (mods) { - var head_arr = []; - for (var n in mods) - head_arr.push(n); - addurl += '&_headers='+head_arr.join(','); - } - } + if (mods) + mods = mods[mbox] ? mods[mbox] : mods['*']; } else if (this.contact_list) { this.contact_list.clear(true); this.show_contentframe(false); } + if (mods) { + for (n in mods) + mods_arr.push(n); + addurl += '&_headers='+mods_arr.join(','); + } + if (this.gui_objects.search_filter) addurl += '&_filter=' + this.gui_objects.search_filter.value; // reset vars this.env.current_page = 1; - var lock = this.set_busy(true, 'searching'); this.http_request('search', '_q='+urlencode(value) - + (this.env.mailbox ? '&_mbox='+urlencode(this.env.mailbox) : '') + + (mbox ? '&_mbox='+urlencode(mbox) : '') + (this.env.source ? '&_source='+urlencode(this.env.source) : '') + (this.env.group ? '&_gid='+urlencode(this.env.group) : '') + (addurl ? addurl : ''), lock); |