Commit 361d082c authored by Christoph Haas's avatar Christoph Haas

Changed HTML Element for rendering

parent cdf612f0
......@@ -23,8 +23,10 @@ Zarafa.plugins.origrcv.OrigRcvPlugin = Ext.extend(Zarafa.core.Plugin, {
*/
showOriginalReceiver: function() {
return {
xtype: 'label',
style: 'width: 99%;',
xtype: 'container',
autoEl: 'div',
style: 'margin-top: 6px;',
cls: 'preview-header-recipientbox',
plugins: ['zarafa.recordcomponentupdaterplugin'],
scope: this,
update: this.onMailDataOpen,
......@@ -38,9 +40,10 @@ Zarafa.plugins.origrcv.OrigRcvPlugin = Ext.extend(Zarafa.core.Plugin, {
* @param {Boolean} contentReset force the component to perform a full update of the data.
*/
onMailDataOpen: function(record, resetContent) {
var label = this.getEl();
// Set label to empty value by default, to override previous S/MIME message text
this.setText("");
this.hide();
label.update(""); // empty div
label.hide();
if (record.opened) {
var toRegex = /^To\s*:\s*(.*)$/igm; // parse "to" header
......@@ -60,16 +63,16 @@ Zarafa.plugins.origrcv.OrigRcvPlugin = Ext.extend(Zarafa.core.Plugin, {
// only display if receiver addresses differ
if (emailAddresses.length == 1 && !(emailAddresses[0] == record.get('display_to') || emailAddresses[0] == record.get('received_by_email_address'))) {
this.setText("Original To: " + emailAddresses[0]);
this.show();
label.update("Original To: " + emailAddresses[0]);
label.show();
} else if (emailAddresses.length > 1) {
var addressList = "";
for (var i = 0; i < emailAddresses.length; i++) {
if (i != 0) addressList += ", ";
addressList += emailAddresses[i];
}
this.setText("Original To: " + addressList);
this.show();
label.update("Original To: " + addressList);
label.show();
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment