Merge pull request #5015 from overleaf/ae-recompile-on-save

Recompile on save key press when PDF preview is focused

GitOrigin-RevId: 9f2c2c5de44c665c9d4c240fb418b9dc321e3523
This commit is contained in:
Alf Eaton 2021-09-14 09:54:47 +01:00 committed by Copybot
parent 69482d9d3c
commit 28082e64ff
2 changed files with 14 additions and 0 deletions

View file

@ -98,6 +98,8 @@ block content
custom-toggler-pane=hasFeature('custom-togglers') ? "west" : false
custom-toggler-msg-when-open=hasFeature('custom-togglers') ? translate("tooltip_hide_filetree") : false
custom-toggler-msg-when-closed=hasFeature('custom-togglers') ? translate("tooltip_show_filetree") : false
ng-keydown="handleKeyDown($event)"
tabindex="0"
)
.ui-layout-west
include ./editor/file-tree-react

View file

@ -314,6 +314,18 @@ If the project has been renamed please look in your project list for a new proje
$scope.switchToSideBySideLayout()
}
$scope.handleKeyDown = event => {
if (event.shiftKey || event.altKey) {
return
}
// Ctrl+s or Cmd+s => recompile
if (event.key === 's' && (event.metaKey || event.ctrlKey)) {
event.preventDefault()
$scope.recompileViaKey()
}
}
try {
;({ userAgent } = navigator)
ide.browserIsSafari =