mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-15 09:04:04 +02:00
3a57cfea02
- Commands "enabled" state is now expressed using a "when-clause" like in VSCode - A command palette has been added to the Tools menu
19 lines
424 B
TypeScript
19 lines
424 B
TypeScript
import { CommandDeclaration, CommandRuntime } from 'lib/services/CommandService';
|
|
import { _ } from 'lib/locale';
|
|
|
|
export const declaration:CommandDeclaration = {
|
|
name: 'toggleSideBar',
|
|
label: () => _('Toggle sidebar'),
|
|
iconName: 'fas fa-bars',
|
|
};
|
|
|
|
export const runtime = (comp:any):CommandRuntime => {
|
|
return {
|
|
execute: async () => {
|
|
comp.props.dispatch({
|
|
type: 'SIDEBAR_VISIBILITY_TOGGLE',
|
|
});
|
|
},
|
|
};
|
|
};
|