1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-24 23:26:50 +02:00

Desktop: Undo changes introduced in #4303 (#4406)

This commit is contained in:
Caleb John
2021-02-06 09:01:06 -07:00
committed by GitHub
parent 11c8bf7e6e
commit 33e1214ef6
18 changed files with 82 additions and 117 deletions

View File

@ -33,16 +33,27 @@ export default class ToolbarButtonUtils {
return this.service_;
}
// Editor commands will focus the editor after they're executed
private isEditorCommand(commandName: string) {
return CommandService.isEditorCommand(commandName) && !(
// These commands are attached to the editor runtime,
// but they either handle focus themselves or don't need
// to focus the editor
commandName === 'textLink' ||
commandName === 'insertText' ||
commandName === 'scrollToHash' ||
commandName === 'selectedText' ||
commandName === 'replaceSelection'
return (commandName.indexOf('editor.') === 0 ||
// These commands are grandfathered in, but in the future
// all editor commands should start with "editor."
// WARNING: Some commands such as textLink are not defined here
// because they are more complex and handle focus manually
commandName === 'textCopy' ||
commandName === 'textCut' ||
commandName === 'textPaste' ||
commandName === 'textSelectAll' ||
commandName === 'textBold' ||
commandName === 'textItalic' ||
commandName === 'textCode' ||
commandName === 'attachFile' ||
commandName === 'textNumberedList' ||
commandName === 'textBulletedList' ||
commandName === 'textCheckbox' ||
commandName === 'textHeading' ||
commandName === 'textHorizontalRule' ||
commandName === 'insertDateTime'
);
}