From edc1f098f38ce971370ab150ea92450c4b726660 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Fri, 18 Mar 2016 16:44:51 +0000 Subject: [PATCH] Hide email address if there's a name, but allow showing it via CSS if desired --- etemplate/js/et2_widget_url.js | 9 +++++++-- etemplate/templates/default/etemplate2.css | 3 +++ mail/templates/default/app.css | 3 +++ mail/templates/pixelegg/app.css | 3 +++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_widget_url.js b/etemplate/js/et2_widget_url.js index 0098b51a57..cb7f7028d8 100644 --- a/etemplate/js/et2_widget_url.js +++ b/etemplate/js/et2_widget_url.js @@ -308,7 +308,7 @@ var et2_url_ro = (function(){ "use strict"; return et2_valueWidget.extend([et2_I this.span.attr("target", "_blank"); } } - // Remove email address if there's a name + // wrap email address if there's a name if (this.span.text() && this.span.text().split("<")) { var val = this.span.text().split("<"); @@ -317,8 +317,13 @@ var et2_url_ro = (function(){ "use strict"; return et2_valueWidget.extend([et2_I // need to preserve the original value somehow // as it's been used for add contact plus feature this.span.attr('title',_value); - + this.span.text(val.replace(/"/g,'')); + this.span.append(""+ + _value.replace(val,'') + .replace(//g, '>') + +""); } diff --git a/etemplate/templates/default/etemplate2.css b/etemplate/templates/default/etemplate2.css index 212cdcd8ff..8c717eebc8 100644 --- a/etemplate/templates/default/etemplate2.css +++ b/etemplate/templates/default/etemplate2.css @@ -185,6 +185,9 @@ a.et2_url.url { box-shadow: none !important; background: transparent !important; } +.et2_email > span.email { + display: none; +} /** * Button widget - text only, and icon */ diff --git a/mail/templates/default/app.css b/mail/templates/default/app.css index e0f5df0097..6efe76e662 100644 --- a/mail/templates/default/app.css +++ b/mail/templates/default/app.css @@ -453,6 +453,9 @@ div.mail-compose_fileselector { position: relative; background-color: white; } +#mail-index_mailPreview .et2_email>span{ + display: inline; +} .maildisplayAllAdresses { max-height: 245px !important; overflow:scroll; diff --git a/mail/templates/pixelegg/app.css b/mail/templates/pixelegg/app.css index 004a420718..77b935aa11 100755 --- a/mail/templates/pixelegg/app.css +++ b/mail/templates/pixelegg/app.css @@ -450,6 +450,9 @@ div.mail-compose_fileselector { position: relative; background-color: white; } +#mail-index_mailPreview .et2_email > span { + display: inline; +} .maildisplayAllAdresses { max-height: 245px !important; overflow: scroll;