diff options
author | thomascube <thomas@roundcube.net> | 2012-04-11 12:52:51 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2012-04-11 12:52:51 +0000 |
commit | 1ba07f070998d32d115d90d0d73db2dca59c4690 (patch) | |
tree | ef33699e9788f5e068e24082397722803fcf907e /program/js | |
parent | 21a0d919380dd56d0c051cfb8570f3e181c34a18 (diff) |
Allow mass-removal of addresses from a group (#1487748)
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/app.js | 26 |
1 files changed, 26 insertions, 0 deletions
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<selection.length; n++) { + id = selection[n]; + this.contact_list.remove_row(id, (n == selection.length-1)); + } + } + } + + + // handler for keyboard events on the input field this.add_input_keydown = function(e) { |