mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-15 09:04:04 +02:00
24 lines
614 B
TypeScript
24 lines
614 B
TypeScript
|
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
|
||
|
const { _ } = require('lib/locale');
|
||
|
|
||
|
export const declaration:CommandDeclaration = {
|
||
|
name: 'focusElementNoteBody',
|
||
|
label: () => _('Note body'),
|
||
|
};
|
||
|
|
||
|
export const runtime = (comp:any):CommandRuntime => {
|
||
|
return {
|
||
|
execute: async () => {
|
||
|
comp.editorRef.current.execCommand({ name: 'focus' });
|
||
|
},
|
||
|
// isEnabled: (props:any):boolean => {
|
||
|
// return props.sidebarVisibility;
|
||
|
// },
|
||
|
// mapStateToProps: (state:any):any => {
|
||
|
// return {
|
||
|
// sidebarVisibility: state.sidebarVisibility,
|
||
|
// };
|
||
|
// },
|
||
|
};
|
||
|
};
|