directly open the menu instead of sending a message
This commit is contained in:
parent
94c1789a2b
commit
4c5a4f3bb1
1 changed files with 5 additions and 6 deletions
|
@ -2,13 +2,13 @@ import Menu from '/scripts/GUI/menus.js';
|
||||||
import texts from "/scripts/mapping/read.js";
|
import texts from "/scripts/mapping/read.js";
|
||||||
|
|
||||||
export default class MenuEntry {
|
export default class MenuEntry {
|
||||||
/* Create all entries. */
|
/* Create all entries. */
|
||||||
constructor() {
|
constructor() {
|
||||||
// Add the context menu.
|
// Add the context menu.
|
||||||
this.menu = new Menu({title: (new texts(`entry_contextMenu`)).localized, contexts: [`all`], events: {"onClicked": MenuEntry.onclick}, hidden: true});
|
this.menu = new Menu({title: (new texts(`entry_contextMenu`)).localized, contexts: [`all`], events: {"onClicked": this.onclick}, hidden: true});
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Enable the sidebar.
|
Enable the sidebar.
|
||||||
*/
|
*/
|
||||||
enable () {
|
enable () {
|
||||||
|
@ -25,8 +25,7 @@ export default class MenuEntry {
|
||||||
/*
|
/*
|
||||||
The onclick event
|
The onclick event
|
||||||
*/
|
*/
|
||||||
static onclick() {
|
onclick() {
|
||||||
// Send the message to open the side panel.
|
this.menu.trigger();
|
||||||
chrome.runtime.sendMessage({"action": "popup_open"});
|
|
||||||
};
|
};
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue