summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js15
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 });
}
}