Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable viewer height #1435

Merged
merged 3 commits into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/files/file-preview/FilePreview.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.FilePreviewPDF {
height: calc(100vh - 140px - 5.5rem);
jessicaschilling marked this conversation as resolved.
Show resolved Hide resolved
jessicaschilling marked this conversation as resolved.
Show resolved Hide resolved
min-height: 100px;
}

@media only screen and (max-width: 60em) {
.FilePreviewPDF {
height: calc(100vh - 234px - 14rem);
jessicaschilling marked this conversation as resolved.
Show resolved Hide resolved
}
}
3 changes: 2 additions & 1 deletion src/files/file-preview/FilePreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import isBinary from 'is-binary'
import { Trans, withTranslation } from 'react-i18next'
import typeFromExt from '../type-from-ext'
import ComponentLoader from '../../loader/ComponentLoader.js'
import './FilePreview.css'

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