From 1ba07f070998d32d115d90d0d73db2dca59c4690 Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 11 Apr 2012 12:52:51 +0000 Subject: Allow mass-removal of addresses from a group (#1487748) --- program/js/app.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'program/js') diff --git a/program/js/app.js b/program/js/app.js index 025a366f1..963049b4e 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -4016,6 +4016,10 @@ function rcube_webmail() } } + // if a group is currently selected, and there is at least one contact selected + // thend we can enable the group-remove-selected command + this.enable_command('group-remove-selected', typeof this.env.group != 'undefined' && list.selection.length > 0); + this.enable_command('compose', this.env.group || list.selection.length > 0); this.enable_command('edit', id && writable); this.enable_command('delete', list.selection.length && writable); @@ -4375,6 +4379,28 @@ function rcube_webmail() this.name_input.select().focus(); }; + //remove selected contacts from current active group + this.group_remove_selected = function() + { + ref.http_post('group-delmembers','_cid='+urlencode(this.contact_list.selection) + + '&_source='+urlencode(this.env.source) + + '&_gid='+urlencode(this.env.group)); + }; + + //callback after deleting contact(s) from current group + this.remove_group_contacts = function(props) + { + if('undefined' != typeof this.env.group && (this.env.group === props.gid)){ + var selection = this.contact_list.get_selection(); + for (var n=0; n