1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-27 23:28:38 +02:00

Desktop: Added support for Menu API for plugins

This commit is contained in:
Laurent Cozic
2020-10-13 12:57:03 +01:00
parent 2caaf8e8c1
commit c648f19693
37 changed files with 5561 additions and 34 deletions

View File

@ -0,0 +1,26 @@
import { MenuItem, MenuItemLocation } from './api/types';
import ViewController from './ViewController';
export default class MenuController extends ViewController {
constructor(id:string, pluginId:string, store:any, label:string, menuItems: MenuItem[], location:MenuItemLocation) {
super(id, pluginId, store);
this.store.dispatch({
type: 'PLUGIN_VIEW_ADD',
pluginId: pluginId,
view: {
id: this.handle,
type: this.type,
label: label,
menuItems: menuItems,
location: location,
},
});
}
public get type():string {
return 'menu';
}
}