Adjust mail preview header part according to its content

This commit is contained in:
Hadi Nategh 2014-09-22 16:25:36 +00:00
parent c27e4f2098
commit c0b92e9f10
5 changed files with 39 additions and 11 deletions

View File

@ -755,16 +755,32 @@ app.classes.mail = AppJS.extend(
// Empty values, just in case selected is empty (user cleared selection)
//dataElem.data is populated, when available with fromaddress(string),toaddress(string),additionaltoaddress(array),ccaddress (array)
var dataElem = {data:{subject:"",fromaddress:"",toaddress:"",ccaddress:"",date:"",attachmentsBlock:""}};
var attachmentArea = this.et2.getWidgetById('previewAttachmentArea');
var previewContainer = this.et2.getWidgetById('mailPreviewContainer');
if(typeof selected != 'undefined' && selected.length == 1)
{
var _id = this.mail_fetchCurrentlyFocussed(selected);
dataElem = jQuery.extend(dataElem, egw.dataGetUIDdata(_id));
}
//get_class does not exist yet
//var pAAClass = this.et2.getWidgetById('previewAttachmentArea').get_class();
if (this.et2.getWidgetById('previewAttachmentArea') && typeof _id != 'undefined' && _id !='' && typeof dataElem !== 'undefined')
if (attachmentArea && typeof _id != 'undefined' && _id !='' && typeof dataElem !== 'undefined')
{
this.et2.getWidgetById('previewAttachmentArea').set_class('previewAttachmentArea');
if (!dataElem.data.attachmentsBlock)
{
if (!dataElem.data.ccaddress)
{
previewContainer.set_class('previewNoAttachment');
}
else
{
previewContainer.set_class('previewNoAttachmentButCC');
}
}
else
{
jQuery(previewContainer.node).removeClass('previewNoAttachment previewNoAttachmentButCC');
}
}
else
{
@ -776,7 +792,7 @@ app.classes.mail = AppJS.extend(
this.mail_disablePreviewArea(true);
return;
}
// Widget ID:data key map of widgets we can directly set from cached data
var data_widgets = {
'previewFromAddress': 'fromaddress',

View File

@ -499,6 +499,12 @@ div.mail-compose_fileselector {
left: 3px;
right: 0;
}
#mail-index_mailPreviewContainer.previewNoAttachment {
top: 51px;
}
#mail-index_mailPreviewContainer.previewNoAttachmentButCC{
top: 67px;
}
#mail-index_previewAttachmentArea {
background-color:#f0f0f0;
max-height: 1.6em;

View File

@ -109,9 +109,9 @@
<buttononly class="et2_button ui-button" label="Show all attachments" image="foldertree_nolines_plus" onclick="app.mail.showAllHeader"/>
</hbox>
<toolbar id="toolbar" class="mailPreviewIcons"/>
<box id="mailPreviewContainer">
<iframe frameborder="1" id="messageIFRAME" scrolling="auto"/>
</box>
<box id="mailPreviewContainer">
<iframe frameborder="1" id="messageIFRAME" scrolling="auto"/>
</box>
</vbox>
</split>
<iframe frameborder="1" height="100%" id="extra_iframe" scrolling="auto" width="100%" disabled="true"/>

View File

@ -499,6 +499,12 @@ div.mail-compose_fileselector {
left: 3px;
right: 0;
}
#mail-index_mailPreviewContainer.previewNoAttachment {
top: 51px;
}
#mail-index_mailPreviewContainer.previewNoAttachmentButCC {
top: 67px;
}
#mail-index_previewAttachmentArea {
background-color: #f0f0f0;
max-height: 1.6em;
@ -834,7 +840,7 @@ div#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersTo {
div#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersDate {
position: absolute;
right: 0px;
margin: 25px 5px 0 0;
margin: 3px 5px 0 0;
}
div#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersSubject {
width: 58%;
@ -2291,7 +2297,7 @@ input[type=button] {
#mail-index_mailPreviewContainer {
position: absolute;
border: 1px solid .color_10_gray;
top: 97px;
top: 113px;
bottom: 0;
left: 3px;
right: 0;

View File

@ -175,7 +175,7 @@ div#mail-index{
div#mail-index_mailPreviewHeadersDate{
position: absolute;
right: 0px;
margin: 25px 5px 0 0;
margin: 3px 5px 0 0;
}
// Subject
@ -1566,7 +1566,7 @@ input[type=button] {
#mail-index_mailPreviewContainer {
position: absolute;
border: 1px solid .color_10_gray;
top: 97px;
top: 113px;
bottom: 0;
left: 3px;
right: 0;