diff --git a/src/manifest.json b/src/manifest.json index 0dc4780..5e949cb 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Container Tabs Sidebar", - "version": "0.0.9", + "version": "0.0.10", "description": "__MSG_description__", "homepage_url": "https://github.com/maciekmm/container-tabs-sidebar", "default_locale": "en", diff --git a/src/sidebar/tab/tab.js b/src/sidebar/tab/tab.js index 34d59df..0416442 100644 --- a/src/sidebar/tab/tab.js +++ b/src/sidebar/tab/tab.js @@ -38,48 +38,50 @@ export default class ContainerTab { return } e.preventDefault() - if (ContextMenuManager.contextMenu) { - ContextMenuManager.hide() - return - } + { + if (ContextMenuManager.contextMenu) { + ContextMenuManager.hide() + return + } - const contextMenu = new ContextMenu(this) + const contextMenu = new ContextMenu(this) - contextMenu.addOption('sidebar_menu_reloadTab', () => { - browser.tabs.reload(this.id) - }) + contextMenu.addOption('sidebar_menu_reloadTab', () => { + browser.tabs.reload(this.id) + }) - contextMenu.addOption((this.tab.mutedInfo && this.tab.mutedInfo.muted) ? 'sidebar_menu_unmuteTab' : 'sidebar_menu_muteTab', () => { - browser.tabs.update(this.id, { - muted: !(this.tab.mutedInfo && this.tab.mutedInfo.muted) + contextMenu.addOption((this.tab.mutedInfo && this.tab.mutedInfo.muted) ? 'sidebar_menu_unmuteTab' : 'sidebar_menu_muteTab', () => { + browser.tabs.update(this.id, { + muted: !(this.tab.mutedInfo && this.tab.mutedInfo.muted) + }) }) - }) - contextMenu.addOption(this.tab.pinned ? 'sidebar_menu_unpinTab' : 'sidebar_menu_pinTab', () => { - browser.tabs.update(this.id, { - pinned: !this.tab.pinned + contextMenu.addOption(this.tab.pinned ? 'sidebar_menu_unpinTab' : 'sidebar_menu_pinTab', () => { + browser.tabs.update(this.id, { + pinned: !this.tab.pinned + }) }) - }) - contextMenu.addOption('sidebar_menu_duplicateTab', () => { - browser.tabs.duplicate(this.id) - }) + contextMenu.addOption('sidebar_menu_duplicateTab', () => { + browser.tabs.duplicate(this.id) + }) - contextMenu.addOption('sidebar_menu_moveTabToNewWindow', () => { - browser.windows.create({ - tabId: this.id + contextMenu.addOption('sidebar_menu_moveTabToNewWindow', () => { + browser.windows.create({ + tabId: this.id + }) }) - }) - contextMenu.addOption('sidebar_menu_closeOtherTabs', () => { - this._container.closeOthers(this.id) - }) + contextMenu.addOption('sidebar_menu_closeOtherTabs', () => { + this._container.closeOthers(this.id) + }) - contextMenu.addOption('sidebar_menu_closeTab', () => { - browser.tabs.remove(this.id) - }) + contextMenu.addOption('sidebar_menu_closeTab', () => { + browser.tabs.remove(this.id) + }) - ContextMenuManager.show(contextMenu, e.clientX, e.clientY) + ContextMenuManager.show(contextMenu, e.clientX, e.clientY) + } }) this.element.addEventListener('dragstart', (e) => {