Skip to content

Commit b67ef26

Browse files
authored
Merge pull request #1665 from Grandi0z/cypht-enh-imap-image-view
refactor(frontend): enhance image display and white space handling in IMAP module
2 parents 833daf5 + 02fd522 commit b67ef26

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

modules/core/site.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ a[disabled] {
15841584

15851585
/* Bootstrap-based message headers */
15861586
.msg_text * {
1587-
white-space: normal !important;
1587+
white-space: normal;
15881588
word-break: break-word;
15891589
overflow-wrap: anywhere;
15901590
}

modules/imap/functions.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,10 @@ function format_attached_image_section($struct, $output_mod, $dl_link) {
711711
$isThereAnyImg = false;
712712
foreach ($struct as $id => $vals) {
713713
if ($vals['type'] === 'image') {
714-
$res .= '<div><img class="attached_image" src="?'.$dl_link.'&amp;imap_msg_part='.$output_mod->html_safe($id).'" ></div>';
714+
$res .= '<div class="col-6 col-md-3">
715+
<img class="attached_image img-fluid"
716+
src="?' . $dl_link . '&amp;imap_msg_part=' . $output_mod->html_safe($id) . '" >
717+
</div>';
715718
$isThereAnyImg = true;
716719
}
717720
if (isset($vals['subs'])) {
@@ -720,7 +723,7 @@ function format_attached_image_section($struct, $output_mod, $dl_link) {
720723
}
721724

722725
if ($isThereAnyImg) {
723-
$res = '<div class="attached_image_box">' . $res . '</div>';
726+
$res = '<div class="container-fluid"><div class="row text-center attached_image_box">' . $res . '</div></div>';
724727
}
725728

726729
return $res;

modules/imap/site.css

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@
222222
text-overflow: ellipsis;
223223
width: 20%;
224224
}
225+
.msg_parts td * {
226+
white-space: nowrap;
227+
}
225228
.download_link {
226229
width: 100px;
227230
}
@@ -442,13 +445,13 @@
442445
}
443446
.mobile .download_link,
444447
.mobile .remove_attachment {
445-
width: 50px !important;
446448
overflow: visible !important;
447-
margin-left: 25px;
448449
}
449450
.mobile .part_desc,
450451
.mobile .part_size {
451-
margin-left: 25px;
452+
white-space: nowrap;
453+
overflow: hidden;
454+
text-overflow: ellipsis;
452455
}
453456
.mobile .unflag_send_div {
454457
float: right;
@@ -465,13 +468,8 @@
465468
height: 200px;
466469
}
467470
.attached_image_box {
468-
display: flex;
469-
flex-wrap: wrap;
470471
border-top: solid 1px #ddd;
471-
padding-top: 20px;
472-
padding-left: 20px;
473-
width: 100%;
474-
padding-bottom: 40px;
472+
padding-top: 1rem;
475473
}
476474
/* .list_meta { float: none; margin-left: 37%; } */
477475

0 commit comments

Comments
 (0)