diff options
author | alecpl <alec@alec.pl> | 2011-07-05 09:42:40 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-07-05 09:42:40 +0000 |
commit | 62811c4a709004abe9145c71f3d14fe00137d900 (patch) | |
tree | bb8a873d47b934e44d9b77da58e294c868afc554 /program/js/app.js | |
parent | 8fc0f9451e63c92ec99eadb8cd13dd69ded69156 (diff) |
- Fix group commands state after extended search use, make this check readonly-flag aware
Diffstat (limited to 'program/js/app.js')
-rw-r--r-- | program/js/app.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/program/js/app.js b/program/js/app.js index a9c345b41..dddcf89cb 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -305,7 +305,7 @@ function rcube_webmail() $(this.gui_objects.qsearchbox).focusin(function() { rcmail.contact_list.blur(); }); } - this.enable_command('group-create', this.env.address_sources[this.env.source].groups); + this.update_group_commands(); } this.set_page_buttons(); @@ -3957,7 +3957,7 @@ function rcube_webmail() this.group_create = function() { - if (!this.gui_objects.folderlist || !this.env.address_sources[this.env.source].groups) + if (!this.gui_objects.folderlist) return; if (!this.name_input) { @@ -4114,6 +4114,13 @@ function rcube_webmail() this.triggerEvent('group_update', { id:prop.id, source:prop.source, name:prop.name, li:li[0], newid:prop.newid }); }; + this.update_group_commands = function() + { + var source = this.env.source != '' ? this.env.address_sources[this.env.source] : null; + this.enable_command('group-create', (source && source.groups && !source.readonly)); + this.enable_command('group-rename', 'group-delete', (source && source.groups && this.env.group && !source.readonly)); + }; + this.init_edit_field = function(col, elem) { if (!elem) @@ -5592,9 +5599,7 @@ function rcube_webmail() this.enable_command('export', (this.contact_list && this.contact_list.rowcount > 0)); if (response.action == 'list' || response.action == 'search') { - var source = this.env.source != '' ? this.env.address_sources[this.env.source] : null; - this.enable_command('group-create', (source && source.groups && !source.readonly)); - this.enable_command('group-rename', 'group-delete', (source && source.groups && this.env.group && !source.readonly)); + this.update_group_commands(); this.triggerEvent('listupdate', { folder:this.env.source, rowcount:this.contact_list.rowcount }); } } |