Commit ae359318 authored by Alexander's avatar Alexander Committed by Johannes

Make mail recipients list foldable

parent 123a75d2
Pipeline #107983705 passed with stages
in 1 minute and 38 seconds
......@@ -75,6 +75,7 @@
- Remove email addresses from the bounce list before sending a confirmation mail !1268 #756 @alex.simm
- Move map control elements on small devices #695 !1286 @lea.mzw
- Move bellupdatetrigger() to maintenance class only executing it nightly. Accidentally fixes the date distance to a unconfirmed slot which was reseted every 5 minutes before !1300 @jofranz
- Made the list of recipients of a mail foldable to avoid unreadable mails !1280 #65 @alex.simm
## Refactoring
- refactored to use count() instead of more complicated expressions !1273 !1296 @Caluera
......
......@@ -34,7 +34,8 @@ expose({
checkEmail,
u_handleNewEmail,
u_addTypeHead,
setAutocompleteAddresses
setAutocompleteAddresses,
mb_foldRecipients
})
function mb_finishFile (newname) {
......@@ -288,3 +289,18 @@ function u_anHasChanged () {
return false
}
}
function mb_foldRecipients (fullString, shortString) {
const button = $('#mail-fold-icon')
const label = $('#mail-to-list')
if (label.data('folded') === true) {
label.html(fullString)
} else {
label.html(shortString)
}
button.toggleClass('fa-sort-down')
button.toggleClass('fa-sort-up')
label.data('folded', !label.data('folded'))
}
......@@ -205,6 +205,14 @@ class MailboxView extends View
$body = nl2br($mail['body']);
}
$fullToString = implode(', ', $an_str);
$foldButton = '';
$shortToString = $fullToString;
if (strlen($fullToString) > 100) {
$shortToString = substr($fullToString, 0, 100) . ' ...';
$foldButton = '<a onclick="mb_foldRecipients(\'' . $fullToString . '\', \'' . $shortToString . '\');return false;" href="#"><i class="fas fa-sort-down fa-lg" id="mail-fold-icon"></i></a>';
}
return '
<div class="popbox">
<div class="message-top">
......@@ -217,8 +225,8 @@ class MailboxView extends View
<td class="data"><a onclick="mb_mailto(\'' . $von['mailbox'] . '@' . $von['host'] . '\');return false;" href="#" title="' . $von['mailbox'] . '@' . $von['host'] . '">' . $von_str . '</a></td>
</tr>
<tr>
<td class="label">' . $this->translationHelper->s('an') . '</td>
<td class="data">' . implode(', ', $an_str) . '</td>
<td class="label">' . $this->translationHelper->s('an') . ' ' . $foldButton . '</td>
<td class="data" id="mail-to-list" data-folded="true">' . $shortToString . '</td>
</tr>
<tr>
<td class="label">' . $this->translationHelper->s('date') . '</td>
......
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