From b714b00864b667fe03f96f895ea4264ab7830b07 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 18 Nov 2009 12:51:21 -0700 Subject: [PATCH] Add e-mail info to context menu if personal name is shown on page. --- imp/js/DimpCore.js | 23 +++++++++++++++++++++-- imp/themes/screen-dimp.css | 4 ++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/imp/js/DimpCore.js b/imp/js/DimpCore.js index 876f85b3a..24106a381 100644 --- a/imp/js/DimpCore.js +++ b/imp/js/DimpCore.js @@ -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) { diff --git a/imp/themes/screen-dimp.css b/imp/themes/screen-dimp.css index 564e2602a..f9353c96b 100644 --- a/imp/themes/screen-dimp.css +++ b/imp/themes/screen-dimp.css @@ -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; -- 2.11.0