Skip to content

Commit b254889

Browse files
Variable viewer height
Makes PDF viewer height take up full screen height Unfortunately can't be based entirely on Tachyons references since fixed pixel heights for assorted header items; suggest eventual rework to fully integrate Tachyons throughout WebUI
1 parent 4bd997d commit b254889

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.FilePreviewPDF {
2+
height: calc(100vh - 140px - 5.5rem);
3+
min-height: 100px;
4+
}
5+
6+
@media only screen and (max-width: 60em) {
7+
.FilePreviewPDF {
8+
height: calc(100vh - 234px - 14rem);
9+
}
10+
}

src/files/file-preview/FilePreview.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import isBinary from 'is-binary'
55
import { Trans, withTranslation } from 'react-i18next'
66
import typeFromExt from '../type-from-ext'
77
import ComponentLoader from '../../loader/ComponentLoader.js'
8+
import './FilePreview.css'
89

910
class Preview extends React.Component {
1011
state = {
@@ -32,7 +33,7 @@ class Preview extends React.Component {
3233
)
3334
case 'pdf':
3435
return (
35-
<object width='100%' height='500px' data={src} type='application/pdf'>
36+
<object className="FilePreviewPDF w-100" data={src} type='application/pdf'>
3637
{t('noPDFSupport')}
3738
<a href={src} download target='_blank' rel='noopener noreferrer' className='underline-hover navy-muted'>{t('downloadPDF')}</a>
3839
</object>

0 commit comments

Comments
 (0)