mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 12:24:25 +02:00
Merge pull request #19156 from overleaf/dp-fit-to-height-shortcut
Add fit to height shortcut to pdf controls GitOrigin-RevId: 7b8c8da7e9e6cf829573ec6c5abab6355d898098
This commit is contained in:
@@ -462,6 +462,11 @@ function PdfJsViewer({ url, pdfFile }: PdfJsViewerProps) {
|
||||
event.preventDefault()
|
||||
setZoom('page-width')
|
||||
break
|
||||
|
||||
case '9':
|
||||
event.preventDefault()
|
||||
setZoom('page-height')
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -12,11 +12,13 @@ const shortcuts = isMac
|
||||
'zoom-in': ['⌘', '+'],
|
||||
'zoom-out': ['⌘', '-'],
|
||||
'fit-to-width': ['⌘', '0'],
|
||||
'fit-to-height': ['⌘', '9'],
|
||||
}
|
||||
: {
|
||||
'zoom-in': ['Ctrl', '+'],
|
||||
'zoom-out': ['Ctrl', '-'],
|
||||
'fit-to-width': ['Ctrl', '0'],
|
||||
'fit-to-height': ['Ctrl', '9'],
|
||||
}
|
||||
|
||||
type PdfZoomDropdownProps = {
|
||||
@@ -121,6 +123,7 @@ function PdfZoomDropdown({
|
||||
</MenuItem>
|
||||
<MenuItem draggable={false} key="page-height" eventKey="page-height">
|
||||
{t('fit_to_height')}
|
||||
<Shortcut keys={shortcuts['fit-to-height']} />
|
||||
</MenuItem>
|
||||
{showPresentOption && <MenuItem divider />}
|
||||
{showPresentOption && (
|
||||
|
||||
Reference in New Issue
Block a user