webmail: for high images (aspect ratio), don't let image extend beyond window height

apparently the flex parent and flex child with grow 1 is unbounded even with a parent height of 100%
This commit is contained in:
Mechiel Lukkien
2023-10-12 21:53:05 +02:00
parent 7dce883097
commit 8dacc31445
2 changed files with 2 additions and 2 deletions

View File

@ -2388,7 +2388,7 @@ const newMsgView = (miv: MsgitemView, msglistView: MsglistView, listMailboxes: l
),
isImage(a) ?
dom.div(
style({flexGrow: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', margin: '0 5em'}),
style({flexGrow: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', maxHeight: 'calc(100% - 50px)', margin: '0 5em'}),
dom.img(
attr.src('msg/'+m.ID+'/view/'+pathStr),
style({backgroundColor: 'white', maxWidth: '100%', maxHeight: '100%', boxShadow: '0 0 20px rgba(0, 0, 0, 0.1)', margin: '0 30px'})