Use dynamic max height for attachment preview (#4651)
Some checks failed
CI / Build, Upload, Test (push) Has been cancelled
Some checks failed
CI / Build, Upload, Test (push) Has been cancelled
This commit is contained in:
parent
e0aaa7e366
commit
181196149a
2 changed files with 5 additions and 1 deletions
|
@ -606,6 +606,7 @@
|
|||
_handleResize() {
|
||||
if (this.disableResize) return;
|
||||
this.style.setProperty("--preview-width", `${this.clientWidth}px`);
|
||||
this.style.setProperty("--screen-height", `${window.screen.availHeight}px`);
|
||||
}
|
||||
|
||||
_handleDragStart(event) {
|
||||
|
|
|
@ -9,7 +9,10 @@ attachment-preview {
|
|||
// Suppose it's A4 size
|
||||
--width-height-ratio: 0.7070707071;
|
||||
--min-height: 56px;
|
||||
--max-height: 600px;
|
||||
// This is set in JS
|
||||
--screen-height: 600px;
|
||||
// Use screen available height - 200px (approximately the height of the toolbars)
|
||||
--max-height: calc(max(var(--screen-height) - 200px, 600px));
|
||||
// This is set in JS
|
||||
--preview-width: 400;
|
||||
--preview-height: calc(min(var(--preview-width) / var(--width-height-ratio), var(--max-height)));
|
||||
|
|
Loading…
Reference in a new issue