Display short headers in preview mode, with toggle to show all

pull/1/head
thomascube 13 years ago
parent e86a21bd83
commit f4aaf84b50

@ -664,6 +664,32 @@ h3.subject {
height: 13px; height: 13px;
} }
#preview-allheaders {
display: none;
}
#preview-shortheaders td.header-title {
padding-right: 0;
}
#preview-shortheaders td.header {
padding-right: 12px;
}
.headers-table .iconlink {
text-indent: -1000px;
padding: 1px 1px 1px 20px;
}
.headers-table .iconlink.add {
background-position: -5px -359px;
}
.headers-table .iconlink.delete {
background-position: -5px -339px;
}
#full-headers { #full-headers {
position: relative; position: relative;
color: #666; color: #666;

@ -8,7 +8,21 @@
<div id="messagepreviewheader"> <div id="messagepreviewheader">
<h3 class="subject"><roundcube:object name="messageHeaders" valueOf="subject" /></h3> <h3 class="subject"><roundcube:object name="messageHeaders" valueOf="subject" /></h3>
<roundcube:object name="messageHeaders" class="headers-table" addicon="/images/addcontact.png" exclude="subject,replyto" />
<table class="headers-table" id="preview-shortheaders"><tbody><tr>
<roundcube:if condition="env:mailbox == config:drafts_mbox || env:mailbox == config:sent_mbox">
<td class="header-title"><roundcube:label name="to" /></td>
<td class="header from"><roundcube:object name="messageHeaders" valueOf="to" addicon="/images/addcontact.png" /></td>
<roundcube:else />
<td class="header-title"><roundcube:label name="from" /></td>
<td class="header from"><roundcube:object name="messageHeaders" valueOf="from" addicon="/images/addcontact.png" /></td>
<roundcube:endif />
<td class="header-title"><roundcube:label name="date" /></td>
<td class="header from"><roundcube:object name="messageHeaders" valueOf="date" /></td>
<td class="header"><a href="#details" id="previewheaderstoggle" class="iconlink add">Details</a>
</tr></tbody></table>
<roundcube:object name="messageHeaders" id="preview-allheaders" class="headers-table" addicon="/images/addcontact.png" exclude="subject,replyto" />
<!-- record navigation --> <!-- record navigation -->
<div id="countcontrols" class="pagenav"> <div id="countcontrols" class="pagenav">

@ -78,6 +78,7 @@ function rcube_mail_ui()
if (rcmail.env.action == 'show' || rcmail.env.action == 'preview') { if (rcmail.env.action == 'show' || rcmail.env.action == 'preview') {
layout_messageview(); layout_messageview();
$("#all-headers").resizable({ handles: 's', minHeight: 50 }); $("#all-headers").resizable({ handles: 's', minHeight: 50 });
$('#previewheaderstoggle').click(function(e){ toggle_preview_headers(this); return false });
} }
else if (rcmail.env.action == 'compose') { else if (rcmail.env.action == 'compose') {
rcmail.addEventListener('aftertoggle-editor', function(){ window.setTimeout(function(){ layout_composeview() }, 100); }); rcmail.addEventListener('aftertoggle-editor', function(){ window.setTimeout(function(){ layout_composeview() }, 100); });
@ -424,6 +425,26 @@ function rcube_mail_ui()
} }
/**
* Switch between short and full headers display in message preview
*/
function toggle_preview_headers(button)
{
$('#preview-shortheaders').toggle();
var full = $('#preview-allheaders').toggle();
// add toggle button to full headers table
if (!full.data('mod')) {
$('<a>').attr('href', '#hide')
.addClass('iconlink remove')
.html('Hide')
.appendTo($('<td>').appendTo($('tr:first', full)))
.click(function(){ toggle_preview_headers(this);return false });
full.data('mod', true);
}
}
/** /**
* *
*/ */

Loading…
Cancel
Save