You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
This commit is contained in:
@ -54,6 +54,16 @@ describe('editorCommandDeclarations', () => {
|
|||||||
},
|
},
|
||||||
true,
|
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) => {
|
])('should create the enabledCondition', (context: Record<string, any>, expected: boolean) => {
|
||||||
const condition = enabledCondition('textBold');
|
const condition = enabledCondition('textBold');
|
||||||
const wc = new WhenClause(condition);
|
const wc = new WhenClause(condition);
|
||||||
|
@ -11,8 +11,9 @@ export const enabledCondition = (commandName: string) => {
|
|||||||
const noteMustBeMarkdown = !workWithHtmlNotes.includes(commandName);
|
const noteMustBeMarkdown = !workWithHtmlNotes.includes(commandName);
|
||||||
|
|
||||||
const output = [
|
const output = [
|
||||||
'!modalDialogVisible',
|
// gotoAnythingVisible: Enable if the command palette (which is a modal dialog) is visible
|
||||||
'!gotoAnythingVisible',
|
'(!modalDialogVisible || gotoAnythingVisible)',
|
||||||
|
|
||||||
markdownEditorOnly ? 'markdownEditorPaneVisible' : '(markdownEditorPaneVisible || richTextEditorVisible)',
|
markdownEditorOnly ? 'markdownEditorPaneVisible' : '(markdownEditorPaneVisible || richTextEditorVisible)',
|
||||||
'oneNoteSelected',
|
'oneNoteSelected',
|
||||||
noteMustBeMarkdown ? 'noteIsMarkdown' : '',
|
noteMustBeMarkdown ? 'noteIsMarkdown' : '',
|
||||||
|
Reference in New Issue
Block a user