mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Fix "add new comment" keyboard shortcut (#15404)
GitOrigin-RevId: d675abbf0977d5c60f332136e98c55a765cf87e9
This commit is contained in:
@@ -12,6 +12,8 @@ import { useCodeMirrorViewContext } from '../../codemirror-editor'
|
||||
import Modal, { useBulkActionsModal } from '../entries/bulk-actions-entry/modal'
|
||||
import getMeta from '../../../../../utils/meta'
|
||||
import useScopeValue from '../../../../../shared/hooks/use-scope-value'
|
||||
import useScopeEventListener from '@/shared/hooks/use-scope-event-listener'
|
||||
import { useCallback } from 'react'
|
||||
|
||||
function EditorWidgets() {
|
||||
const { t } = useTranslation()
|
||||
@@ -54,6 +56,13 @@ function EditorWidgets() {
|
||||
}, 0)
|
||||
}
|
||||
|
||||
useScopeEventListener(
|
||||
'comment:start_adding',
|
||||
useCallback(() => {
|
||||
setIsAddingComment(true)
|
||||
}, [setIsAddingComment])
|
||||
)
|
||||
|
||||
return ReactDOM.createPortal(
|
||||
<>
|
||||
<div className="rp-in-editor-widgets react-rp-in-editor-widgets">
|
||||
|
||||
@@ -786,7 +786,7 @@ export default App.controller('ReviewPanelController', [
|
||||
|
||||
ide.$scope.addNewComment = function (e) {
|
||||
e.preventDefault()
|
||||
$scope.$broadcast('comment:start_adding')
|
||||
ide.$scope.$broadcast('comment:start_adding')
|
||||
return $scope.toggleReviewPanel()
|
||||
}
|
||||
|
||||
@@ -802,7 +802,7 @@ export default App.controller('ReviewPanelController', [
|
||||
}
|
||||
return $timeout(function () {
|
||||
ide.$scope.$broadcast('review-panel:layout')
|
||||
return $scope.$broadcast('comment:start_adding')
|
||||
ide.$scope.$broadcast('comment:start_adding')
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user