2020-10-09 19:35:46 +02:00
|
|
|
import { MenuItemLocation } from './api/types';
|
|
|
|
import ViewController from './ViewController';
|
|
|
|
|
|
|
|
export default class MenuItemController extends ViewController {
|
|
|
|
|
2023-03-06 16:22:01 +02:00
|
|
|
public constructor(id: string, pluginId: string, store: any, commandName: string, location: MenuItemLocation) {
|
2020-10-09 19:35:46 +02:00
|
|
|
super(id, pluginId, store);
|
|
|
|
|
|
|
|
this.store.dispatch({
|
|
|
|
type: 'PLUGIN_VIEW_ADD',
|
|
|
|
pluginId: pluginId,
|
|
|
|
view: {
|
|
|
|
id: this.handle,
|
|
|
|
type: this.type,
|
|
|
|
commandName: commandName,
|
|
|
|
location: location,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-11-12 21:13:28 +02:00
|
|
|
public get type(): string {
|
2020-10-09 19:35:46 +02:00
|
|
|
return 'menuItem';
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|