Add e-mail info to context menu if personal name is shown on page.
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 18 Nov 2009 19:51:21 +0000 (12:51 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 18 Nov 2009 22:41:57 +0000 (15:41 -0700)
imp/js/DimpCore.js
imp/themes/screen-dimp.css

index 876f85b..24106a3 100644 (file)
@@ -419,8 +419,27 @@ var DimpCore = {
         }
     },
 
-    // By default, no context onShow action
-    contextOnShow: Prototype.emptyFunction,
+    contextOnShow: function(ctx_id, baseelt)
+    {
+        var tmp;
+
+        switch (ctx_id) {
+        case 'ctx_contacts':
+            tmp = $(ctx_id).down('DIV.contactAddr');
+            if (tmp) {
+                tmp.next().remove();
+                tmp.remove();
+            }
+
+            // Add e-mail info to context menu if personal name is shown on
+            // page.
+            if (baseelt.retrieve('personal')) {
+                $(ctx_id).insert({ top: new Element('DIV', { className: 'sep' }) });
+                $(ctx_id).insert({ top: new Element('DIV', { className: 'contactAddr' }).insert(baseelt.retrieve('email').escapeHTML()) });
+            }
+            break;
+        }
+    },
 
     contextOnClick: function(elt, baseelt, menu)
     {
index 564e260..f9353c9 100644 (file)
@@ -721,6 +721,10 @@ span.attachmentImg {
     margin: 1px 0;
     padding: 0;
 }
+.context div.contactAddr {
+    font-style: italic;
+    text-align: center;
+}
 .contextSubmenu {
     background: url("graphics/popright.png") 100% 50% no-repeat;
     padding-left: 16px;