Fix bug where attachment size wasn't visible when the filename was too long (#6033)

Uses flexbox, so works in recent browsers only. I don't plan to support olders.
pull/6120/merge
Aleksander Machniak 7 years ago
parent af9550251e
commit e4c7e8ac7c

@ -55,6 +55,7 @@ CHANGELOG Roundcube Webmail
- Localized timezone selector (#4983) - Localized timezone selector (#4983)
- Use 7bit encoding for ISO-2022-* charsets in sent mail (#5640) - Use 7bit encoding for ISO-2022-* charsets in sent mail (#5640)
- Handle inline images also inside multipart/mixed messages (#5905) - Handle inline images also inside multipart/mixed messages (#5905)
- Fix bug where attachment size wasn't visible when the filename was too long (#6033)
- Fix checking table columns when there's more schemas/databases in postgres/mysql (#6047) - Fix checking table columns when there's more schemas/databases in postgres/mysql (#6047)
- Fix css conflicts in user interface and e-mail content (#5891) - Fix css conflicts in user interface and e-mail content (#5891)
- Fix duplicated signature when using Back button in Chrome (#5809) - Fix duplicated signature when using Back button in Chrome (#5809)

@ -226,7 +226,7 @@ function rcmail_attachment_success($attachment, $uploadid)
$button = ''; $button = '';
} }
$link_content = sprintf('%s <span class="attachment-size"> (%s)</span>', $link_content = sprintf('<span class="attachment-name">%s</span><span class="attachment-size">(%s)</span>',
rcube::Q($attachment['name']), $RCMAIL->show_bytes($attachment['size'])); rcube::Q($attachment['name']), $RCMAIL->show_bytes($attachment['size']));
$content_link = html::a(array( $content_link = html::a(array(

@ -1185,7 +1185,7 @@ function rcmail_compose_attachment_list($attrib)
continue; continue;
} }
$link_content = sprintf('%s <span class="attachment-size"> (%s)</span>', $link_content = sprintf('<span class="attachment-name">%s</span> <span class="attachment-size">(%s)</span>',
rcube::Q($a_prop['name']), $RCMAIL->show_bytes($a_prop['size'])); rcube::Q($a_prop['name']), $RCMAIL->show_bytes($a_prop['size']));
$content_link = html::a(array( $content_link = html::a(array(

@ -200,7 +200,6 @@ function rcmail_message_attachments($attrib)
$mimetype = rcmail_fix_mimetype($attach_prop->mimetype); $mimetype = rcmail_fix_mimetype($attach_prop->mimetype);
$class = rcube_utils::file2class($mimetype, $filename); $class = rcube_utils::file2class($mimetype, $filename);
$id = 'attach' . $attach_prop->mime_id; $id = 'attach' . $attach_prop->mime_id;
$size = html::span('attachment-size', '(' . rcube::Q($filesize) . ')');
if ($attrib['maxlength'] && mb_strlen($filename) > $attrib['maxlength']) { if ($attrib['maxlength'] && mb_strlen($filename) > $attrib['maxlength']) {
$title = $filename; $title = $filename;
@ -210,7 +209,8 @@ function rcmail_message_attachments($attrib)
$title = ''; $title = '';
} }
$item = rcube::Q($filename) . ' ' . $size; $item = html::span('attachment-name', rcube::Q($filename))
. html::span('attachment-size', '(' . rcube::Q($filesize) . ')');
if (!$PRINT_MODE) { if (!$PRINT_MODE) {
$item = html::a(array( $item = html::a(array(
@ -219,6 +219,7 @@ function rcmail_message_attachments($attrib)
rcmail_output::JS_OBJECT_NAME, $attach_prop->mime_id), rcmail_output::JS_OBJECT_NAME, $attach_prop->mime_id),
'onmouseover' => $title ? '' : 'rcube_webmail.long_subject_title_ex(this, 0)', 'onmouseover' => $title ? '' : 'rcube_webmail.long_subject_title_ex(this, 0)',
'title' => $title, 'title' => $title,
'class' => 'filename',
), $item); ), $item);
$attachments[$attach_prop->mime_id] = $mimetype; $attachments[$attach_prop->mime_id] = $mimetype;

@ -2979,6 +2979,20 @@ ul.toolbarmenu li span.copy {
background-position: -6px -378px; background-position: -6px -378px;
} }
.attachmentslist li a.filename {
display: flex;
overflow: hidden;
}
.attachmentslist li .attachment-name {
overflow: hidden;
text-overflow: ellipsis;
}
.attachmentslist li .attachment-size {
padding: 0 .25em;
}
/*** fieldset tabs ***/ /*** fieldset tabs ***/
.tabbed.ui-tabs { .tabbed.ui-tabs {

Loading…
Cancel
Save