2020-07-03 22:32:39 +01:00
|
|
|
import { CommandRuntime, CommandDeclaration } from '../../../lib/services/CommandService';
|
|
|
|
const { _ } = require('lib/locale');
|
|
|
|
|
|
|
|
export const declaration:CommandDeclaration = {
|
|
|
|
name: 'focusElementNoteBody',
|
|
|
|
label: () => _('Note body'),
|
2020-09-13 17:21:11 +01:00
|
|
|
parentLabel: () => _('Focus'),
|
2020-07-03 22:32:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
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,
|
|
|
|
// };
|
|
|
|
// },
|
|
|
|
};
|
|
|
|
};
|