Skip to content

Commit

Permalink
bump version to 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maciekmm committed Oct 23, 2019
1 parent d23422f commit c8381bc
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
62 changes: 32 additions & 30 deletions src/sidebar/tab/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit c8381bc

Please sign in to comment.