mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Feat: add word and sentence counts for selected text
This commit is contained in:
@@ -68,7 +68,17 @@ export const ToolbarMenuBar = () => {
|
||||
type: 'command',
|
||||
label: t('word_count_lower'),
|
||||
disabled: !wordCountEnabled,
|
||||
handler: () => {
|
||||
handler: ({ location }) => {
|
||||
if (location === 'menu-bar') {
|
||||
const event = new Event('word-count:open-requested', {
|
||||
cancelable: true,
|
||||
})
|
||||
|
||||
if (!window.dispatchEvent(event)) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
setShowWordCountModal(true)
|
||||
},
|
||||
id: 'word_count',
|
||||
|
||||
Reference in New Issue
Block a user