- Improve headers toggle button

pull/1/head
alecpl 13 years ago
parent 2c1937220e
commit 9bd97cc707

@ -699,17 +699,21 @@ h3.subject {
padding-right: 12px; padding-right: 12px;
} }
#messagepreviewheader .iconlink { #previewheaderstoggle {
text-indent: -1000px; width: 16px;
padding: 1px 1px 1px 20px; height: 16px;
padding: 0;
margin-top: 5px;
position: absolute;
outline: none;
} }
#messagepreviewheader .iconlink.add { #previewheaderstoggle.iconlink.add {
background-position: -5px -359px; background-position: -30px -241px;
} }
#messagepreviewheader .iconlink.delete { #previewheaderstoggle.iconlink.remove {
background-position: -5px -339px; background-position: -8px -241px;
} }
#full-headers { #full-headers {
@ -779,7 +783,7 @@ div.hide-headers {
} }
#messagepreviewheader .headers-table { #messagepreviewheader .headers-table {
margin: 0 -8px; margin-left: 10px;
} }
#messagepreviewheader h3.subject { #messagepreviewheader h3.subject {

@ -9,6 +9,8 @@
<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>
<a href="#details" id="previewheaderstoggle" class="iconlink add"></a>
<table class="headers-table" id="preview-shortheaders"><tbody><tr> <table class="headers-table" id="preview-shortheaders"><tbody><tr>
<roundcube:if condition="env:mailbox == config:drafts_mbox || env:mailbox == config:sent_mbox"> <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-title"><roundcube:label name="to" /></td>
@ -19,7 +21,6 @@
<roundcube:endif /> <roundcube:endif />
<td class="header-title"><roundcube:label name="date" /></td> <td class="header-title"><roundcube:label name="date" /></td>
<td class="header from"><roundcube:object name="messageHeaders" valueOf="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> </tr></tbody></table>
<roundcube:object name="messageHeaders" id="preview-allheaders" class="headers-table" addicon="/images/addcontact.png" exclude="subject,replyto" /> <roundcube:object name="messageHeaders" id="preview-allheaders" class="headers-table" addicon="/images/addcontact.png" exclude="subject,replyto" />

@ -462,17 +462,14 @@ function rcube_mail_ui()
function toggle_preview_headers(button) function toggle_preview_headers(button)
{ {
$('#preview-shortheaders').toggle(); $('#preview-shortheaders').toggle();
var full = $('#preview-allheaders').toggle(); var full = $('#preview-allheaders').toggle(),
button = $('a#previewheaderstoggle');
// add toggle button to full headers table // add toggle button to full headers table
if (!full.data('mod')) { if (full.is(':visible'))
$('<a>').attr('href', '#hide') button.attr('href', '#hide').removeClass('add').addClass('remove')
.addClass('iconlink remove') else
.html('Hide') button.attr('href', '#details').removeClass('remove').addClass('add')
.appendTo($('<td>').appendTo($('tr:first', full)))
.click(function(){ toggle_preview_headers(this);return false });
full.data('mod', true);
}
} }

Loading…
Cancel
Save