summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js/app.js
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-22 15:24:39 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-22 15:24:39 +0000
commita5d1e6f6ff83ac74fdebe355ff223dccd367a738 (patch)
treeaf6cb04940000e60d3aad889c5354b7e6a18d807 /roundcubemail/program/js/app.js
parenta3a8725e7dd22c3dec00138ea22e54e4e4804ed4 (diff)
List groups in address detail view and allow to subscribe/unsubscribe from there (#1486753)
git-svn-id: https://svn.roundcube.net/trunk@4121 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js/app.js')
-rw-r--r--roundcubemail/program/js/app.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js
index 45569ea95..4587ce898 100644
--- a/roundcubemail/program/js/app.js
+++ b/roundcubemail/program/js/app.js
@@ -306,8 +306,18 @@ function rcube_webmail()
this.enable_command('group-create', this.env.address_sources[this.env.source].groups);
}
- if (this.env.cid)
+ if (this.env.cid) {
this.enable_command('show', 'edit', true);
+ // register handlers for group assignment via checkboxes
+ if (this.gui_objects.editform) {
+ $('input.groupmember').change(function(){
+ var cmd = this.checked ? 'group-addmembers' : 'group-delmembers';
+ ref.http_post(cmd, '_cid='+urlencode(ref.env.cid)
+ + '&_source='+urlencode(ref.env.source)
+ + '&_gid='+urlencode(this.value));
+ });
+ }
+ }
if ((this.env.action=='add' || this.env.action=='edit') && this.gui_objects.editform) {
this.enable_command('save', true);
@@ -3713,7 +3723,7 @@ function rcube_webmail()
{
// exit if no mailbox specified or if selection is empty
var selection = this.contact_list.get_selection();
- if (!(selection.length || this.env.cid) || (!this.env.group && !confirm(this.get_label('deletecontactconfirm'))))
+ if (!(selection.length || this.env.cid) || !confirm(this.get_label('deletecontactconfirm')))
return;
var id, a_cids = [], qs = '';
@@ -3737,10 +3747,7 @@ function rcube_webmail()
qs += '&_search='+this.env.search_request;
// send request to server
- if (this.env.group)
- this.http_post('group-delmembers', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source)+'&_gid='+urlencode(this.env.group)+qs);
- else
- this.http_post('delete', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source)+'&_from='+(this.env.action ? this.env.action : '')+qs);
+ this.http_post('delete', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source)+'&_from='+(this.env.action ? this.env.action : '')+qs);
return true;
};