Merge pull request #8473 from overleaf/ii-cm6-missing-keyboard-shortcuts-2

[cm6] Add missing keyboard shortcuts 2

GitOrigin-RevId: 29f68cd2eb9d0ad931fff463f76ddb91b5275516
This commit is contained in:
Jakob Ackermann 2022-06-21 13:15:35 +01:00 committed by Copybot
parent bfad0841a4
commit b04bc4798e
2 changed files with 23 additions and 6 deletions

View file

@ -133,12 +133,14 @@ App.controller(
$scope.chat = {}
ide.toggleReviewPanel = $scope.toggleReviewPanel = function () {
if (!$scope.project.features.trackChangesVisible) {
return
}
$scope.ui.reviewPanelOpen = !$scope.ui.reviewPanelOpen
eventTracking.sendMB('rp-toggle-panel', {
value: $scope.ui.reviewPanelOpen,
$scope.$applyAsync(() => {
if (!$scope.project.features.trackChangesVisible) {
return
}
$scope.ui.reviewPanelOpen = !$scope.ui.reviewPanelOpen
eventTracking.sendMB('rp-toggle-panel', {
value: $scope.ui.reviewPanelOpen,
})
})
}

View file

@ -1301,6 +1301,21 @@ export default App.controller(
$scope.$broadcast('editor:focus:changed', from, to, !empty)
break
}
case 'add-new-comment': {
$scope.addNewCommentFromKbdShortcut()
break
}
case 'toggle-track-changes': {
$scope.toggleTrackChangesFromKbdShortcut()
break
}
case 'toggle-review-panel': {
ide.toggleReviewPanel()
break
}
}
})
}