Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnuqw committed Sep 12, 2019
2 parents 1f23e53 + d1c0925 commit ff39884
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion addon/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"author": "mbnuqw",
"name": "__MSG_ExtName__",
"version": "3.0.5",
"version": "3.0.6",
"default_locale": "en",
"description": "__MSG_ExtDesc__",
"homepage_url": "https://github.com/mbnuqw/sidebery",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sidebery",
"version": "3.0.5",
"version": "3.0.6",
"description": "Manage your tabs and bookmarks in sidebar",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/sidebar/actions/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function chooseWin() {
/**
* Retrieve current permissions
*/
async function loadPermissions() {
async function loadPermissions(init) {
this.state.permAllUrls = await browser.permissions.contains({ origins: ['<all_urls>'] })
this.state.permTabHide = await browser.permissions.contains({ permissions: ['tabHide'] })

Expand All @@ -117,7 +117,7 @@ async function loadPermissions() {
if (c.includeHostsActive) c.includeHostsActive = false
if (c.excludeHostsActive) c.excludeHostsActive = false
})
this.actions.savePanels()
if (!init) this.actions.savePanels()
}

if (!this.state.permTabHide) {
Expand Down
13 changes: 13 additions & 0 deletions src/sidebar/actions/panels.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ async function loadPanels() {
panels: Utils.cloneArray(DEFAULT_PANELS)
})

// Check if default panels are present
let bookmarksPanelIndex = ans.panels.findIndex(p => p.type === 'bookmarks')
let defaultPanelIndex = ans.panels.findIndex(p => p.type === 'default')
if (bookmarksPanelIndex === -1 && this.state.bookmarksPanel) {
ans.panels.unshift(Utils.cloneObject(DEFAULT_BOOKMARKS_PANEL))
bookmarksPanelIndex = 0
}
if (defaultPanelIndex === -1) {
let defaultPanelClone = Utils.cloneObject(DEFAULT_TABS_PANEL)
ans.panels.splice(bookmarksPanelIndex + 1, 0, defaultPanelClone)
}

const panels = []
const panelsMap = {}
let saveNeeded
Expand Down Expand Up @@ -221,6 +233,7 @@ function updatePanelsRanges() {
* Save panels
*/
async function savePanels() {
if (this.state.private) return
if (!this.state.windowFocused) return
const output = []
for (let panel of this.state.panels) {
Expand Down
9 changes: 7 additions & 2 deletions src/sidebar/components/pinned-tab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,13 @@ export default {
* Handle mouseup event
*/
onMouseUp(e) {
if (e.button === 0 && this.longClickActionLeft) {
this.longClickActionLeft = clearTimeout(this.longClickActionLeft)
if (e.button === 0) {
if (State.selected.length && !e.ctrlKey && !e.shiftKey) {
browser.tabs.update(this.tab.id, { active: true })
}
if (this.longClickActionLeft) {
this.longClickActionLeft = clearTimeout(this.longClickActionLeft)
}
}
if (e.button === 2) {
Expand Down
9 changes: 7 additions & 2 deletions src/sidebar/components/tab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,13 @@ export default {
* Handle mouseup event
*/
onMouseUp(e) {
if (e.button === 0 && this.longClickActionLeft) {
this.longClickActionLeft = clearTimeout(this.longClickActionLeft)
if (e.button === 0) {
if (State.selected.length && !e.ctrlKey && !e.shiftKey) {
browser.tabs.update(this.tab.id, { active: true })
}
if (this.longClickActionLeft) {
this.longClickActionLeft = clearTimeout(this.longClickActionLeft)
}
}
if (e.button === 2) {
Expand Down
2 changes: 1 addition & 1 deletion src/sidebar/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default new Vue({
await Actions.loadCSSVars()
Actions.scrollToActiveTab()
Actions.loadFavicons()
Actions.loadPermissions()
Actions.loadPermissions(true)
Actions.updateTabsVisability()
Actions.saveTabsTree()

Expand Down

0 comments on commit ff39884

Please sign in to comment.