fix syntax when referring to events
This commit is contained in:
parent
300b5961e0
commit
7e07a9e2fd
2 changed files with 4 additions and 4 deletions
|
@ -6,7 +6,7 @@ export default class MenuEntry {
|
|||
/* Create all entries. */
|
||||
constructor() {
|
||||
// Add the context menu.
|
||||
this.menu = new Menu({title: (new texts(`entry_contextMenu`)).localized, contexts: [`all`], event: {"onClicked": MenuEntry.onclick}, hidden: true});
|
||||
this.menu = new Menu({title: (new texts(`entry_contextMenu`)).localized, contexts: [`all`], events: {"onClicked": MenuEntry.onclick}, hidden: true});
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -22,6 +22,6 @@ export default class MenuEntry {
|
|||
}
|
||||
|
||||
static onclick() {
|
||||
new ManagedSidebar();
|
||||
ManagedSidebar.enable();
|
||||
};
|
||||
}
|
|
@ -15,7 +15,7 @@ export default class Menu {
|
|||
this.ID = String((ID) ? ID : (Math.random() / Math.random() * 100));
|
||||
this.title = (title) ? title : `Menu`;
|
||||
this.contexts = (Array.isArray(contexts)) ? contexts : [`all`];
|
||||
this.events = (event) ? event : {"onClicked" : function() {}};
|
||||
this.events = (events) ? events : {"onClicked" : function() {}};
|
||||
this.type = (((typeof type).includes(`str`) && type) ? type.trim() : false) ? type : `normal`;
|
||||
|
||||
if (icon) {
|
||||
|
@ -43,7 +43,7 @@ export default class Menu {
|
|||
this.hidden = false;
|
||||
this.ID = chrome.contextMenus.create(this.#options);
|
||||
|
||||
if (((this.events && (typeof this.events).includes(`obj`) && !Array.isArray(this.events))) ? Object.keys(events) > 0 : false) {
|
||||
if (((this.events && (typeof this.events).includes(`obj`) && !Array.isArray(this.events))) ? Object.keys(this.events) > 0 : false) {
|
||||
(Object.keys(this.events)).forEach((EVENT) => {
|
||||
chrome.contextMenus[EVENT].addListener((info, tab) => {
|
||||
((info.menuItemId) ? info.menuItemId == this.ID : false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue