diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2013-01-25 14:27:25 +0100 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2013-01-25 14:38:18 +0100 |
commit | 490119976193a92acdbacd50b86ee7afd9e38ef8 (patch) | |
tree | 285f3dc4aac9061fad7e1172853326e4d3d8274c /program/js | |
parent | 5a0875ecb6d0dbaf678585f099e73d768fea5e2c (diff) |
Add search box to compose address book widget (#1488381)
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/app.js | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/program/js/app.js b/program/js/app.js index 64f29f1f7..b9fe9f60f 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3,8 +3,8 @@ | Roundcube Webmail Client Script | | | | This file is part of the Roundcube Webmail client | - | Copyright (C) 2005-2012, The Roundcube Dev Team | - | Copyright (C) 2011, Kolab Systems AG | + | Copyright (C) 2005-2013, The Roundcube Dev Team | + | Copyright (C) 2011-2012, Kolab Systems AG | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | @@ -219,7 +219,7 @@ function rcube_webmail() if (this.gui_objects.qsearchbox) { if (this.env.search_text != null) this.gui_objects.qsearchbox.value = this.env.search_text; - $(this.gui_objects.qsearchbox).focusin(function() { rcmail.message_list.blur(); }); + $(this.gui_objects.qsearchbox).focusin(function() { rcmail.message_list && rcmail.message_list.blur(); }); } this.set_button_titles(); @@ -251,7 +251,7 @@ function rcube_webmail() } } else if (this.env.action == 'compose') { - this.env.compose_commands = ['send-attachment', 'remove-attachment', 'send', 'cancel', 'toggle-editor', 'list-adresses', 'extwin']; + this.env.compose_commands = ['send-attachment', 'remove-attachment', 'send', 'cancel', 'toggle-editor', 'list-adresses', 'search', 'reset-search', 'extwin']; if (this.env.drafts_mailbox) this.env.compose_commands.push('savedraft') @@ -1050,8 +1050,13 @@ function rcube_webmail() this.reset_qsearch(); this.select_all_mode = false; - if (s && this.env.mailbox) + if (s && this.env.action == 'compose') { + if (this.contact_list) + this.list_contacts_clear(); + } + else if (s && this.env.mailbox) { this.list_mailbox(this.env.mailbox, 1); + } else if (s && this.task == 'addressbook') { if (this.env.source == '') { for (n in this.env.address_sources) break; @@ -3647,7 +3652,8 @@ function rcube_webmail() // reset vars this.env.current_page = 1; - r = this.http_request('search', url, lock); + var action = this.env.action == 'compose' && this.contact_list ? 'search-contacts' : 'search'; + r = this.http_request(action, url, lock); this.env.qsearch = {lock: lock, request: r}; } @@ -4141,7 +4147,7 @@ function rcube_webmail() if (this.env.search_id) folder = 'S'+this.env.search_id; - else + else if (!this.env.search_request) folder = group ? 'G'+src+group : src; this.select_folder(folder); @@ -4194,7 +4200,7 @@ function rcube_webmail() this.env.source = src; this.env.group = group; - // also send search request to get the right messages + // also send search request to get the right records if (this.env.search_request) url._search = this.env.search_request; |