mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-30 10:36:35 +02:00
This commit is contained in:
parent
e462881502
commit
8b9ce9ec72
@ -54,6 +54,16 @@ describe('editorCommandDeclarations', () => {
|
||||
},
|
||||
true,
|
||||
],
|
||||
[
|
||||
// In the Markdown editor, and the command palette is visible
|
||||
{
|
||||
markdownEditorPaneVisible: true,
|
||||
richTextEditorVisible: false,
|
||||
gotoAnythingVisible: true,
|
||||
modalDialogVisible: true,
|
||||
},
|
||||
true,
|
||||
],
|
||||
])('should create the enabledCondition', (context: Record<string, any>, expected: boolean) => {
|
||||
const condition = enabledCondition('textBold');
|
||||
const wc = new WhenClause(condition);
|
||||
|
@ -11,8 +11,9 @@ export const enabledCondition = (commandName: string) => {
|
||||
const noteMustBeMarkdown = !workWithHtmlNotes.includes(commandName);
|
||||
|
||||
const output = [
|
||||
'!modalDialogVisible',
|
||||
'!gotoAnythingVisible',
|
||||
// gotoAnythingVisible: Enable if the command palette (which is a modal dialog) is visible
|
||||
'(!modalDialogVisible || gotoAnythingVisible)',
|
||||
|
||||
markdownEditorOnly ? 'markdownEditorPaneVisible' : '(markdownEditorPaneVisible || richTextEditorVisible)',
|
||||
'oneNoteSelected',
|
||||
noteMustBeMarkdown ? 'noteIsMarkdown' : '',
|
||||
|
Loading…
Reference in New Issue
Block a user