joplin/packages/app-desktop/gui/MainScreen/commands/toggleVisiblePanes.ts

21 lines
523 B
TypeScript
Raw Normal View History

2020-11-05 16:58:23 +00:00
import { CommandDeclaration, CommandRuntime } from '@joplinapp/lib/services/CommandService';
import { _ } from '@joplinapp/lib/locale';
export const declaration:CommandDeclaration = {
name: 'toggleVisiblePanes',
label: () => _('Toggle editor layout'),
2020-09-15 13:01:07 +00:00
iconName: 'icon-layout ',
};
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async () => {
comp.props.dispatch({
type: 'NOTE_VISIBLE_PANES_TOGGLE',
});
},
enabledCondition: 'markdownEditorVisible && oneNoteSelected',
};
};