From dc6c4f4a28652f428a507b0335f418749cdbc3bd Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Mon, 10 Oct 2011 16:15:46 -0400
Subject: [PATCH] Contact groups can have direct email addresses => distribution lists; enable 'compose' command for the selected group

---
 program/js/app.js |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index caae45d..86575b0 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -845,7 +845,9 @@
           }
 
           if (a_cids.length)
-            this.http_post('mailto', {_cid: a_cids.join(','), _source: this.env.source}, true);
+            this.http_post('mailto', { _cid: a_cids.join(','), _source: this.env.source}, true);
+          else if (this.env.group)
+            this.http_post('mailto', { _gid: this.env.group, _source: this.env.source}, true);
 
           break;
         }
@@ -3882,7 +3884,7 @@
       }
     }
 
-    this.enable_command('compose', 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);
 
@@ -3968,7 +3970,8 @@
   {
     this.contact_list.clear(true);
     this.show_contentframe(false);
-    this.enable_command('delete', 'compose', false);
+    this.enable_command('delete', false);
+    this.enable_command('compose', this.env.group ? true : false);
   };
 
   // load contact record

--
Gitblit v1.9.1