Skip to content

Commit

Permalink
Fixed: Match position settings when opening bookmark and history
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnuqw committed Jul 19, 2023
1 parent fb33a8f commit 6d04fcc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/services/bookmarks.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ export function getMouseOpeningConf(button: number): OpeningBookmarksConfig {
// Left click
if (button === 0) {
const panelId = Sidebar.getRecentTabsPanelId()
const panel = Sidebar.panelsById[panelId]
conf.useActiveTab = Settings.state.bookmarksLeftClickAction === 'open_in_act'
conf.activateFirstTab = Settings.state.bookmarksLeftClickActivate
conf.dst.panelId = panelId
Expand All @@ -281,12 +282,15 @@ export function getMouseOpeningConf(button: number): OpeningBookmarksConfig {
conf.dst.index = activeTab.index + 1
conf.dst.parentId = activeTab.parentId
}
} else if (Utils.isTabsPanel(panel)) {
conf.dst.index = Tabs.getIndexForNewTab(panel)
}
}

// Middle click
else if (button === 1) {
const panelId = Sidebar.getRecentTabsPanelId()
const panel = Sidebar.panelsById[panelId]
conf.activateFirstTab = Settings.state.bookmarksMidClickActivate
conf.removeBookmark = Settings.state.bookmarksMidClickRemove
conf.dst.panelId = panelId
Expand All @@ -296,6 +300,8 @@ export function getMouseOpeningConf(button: number): OpeningBookmarksConfig {
conf.dst.index = activeTab.index + 1
conf.dst.parentId = activeTab.parentId
}
} else if (Utils.isTabsPanel(panel)) {
conf.dst.index = Tabs.getIndexForNewTab(panel)
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/services/history.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ export function getMouseOpeningConf(button: number): OpeningHistoryConfig {
// Left click
if (button === 0) {
const panelId = Sidebar.getRecentTabsPanelId()
const panel = Sidebar.panelsById[panelId]
conf.useActiveTab = Settings.state.historyLeftClickAction === 'open_in_act'
conf.activateFirstTab = Settings.state.historyLeftClickActivate
conf.dst.panelId = panelId
Expand All @@ -444,12 +445,15 @@ export function getMouseOpeningConf(button: number): OpeningHistoryConfig {
conf.dst.index = activeTab.index + 1
conf.dst.parentId = activeTab.parentId
}
} else if (Utils.isTabsPanel(panel)) {
conf.dst.index = Tabs.getIndexForNewTab(panel)
}
}

// Middle click
else if (button === 1) {
const panelId = Sidebar.getRecentTabsPanelId()
const panel = Sidebar.panelsById[panelId]
conf.activateFirstTab = Settings.state.historyMidClickActivate
conf.dst.panelId = panelId
if (Settings.state.historyMidClickPos === 'after') {
Expand All @@ -458,6 +462,8 @@ export function getMouseOpeningConf(button: number): OpeningHistoryConfig {
conf.dst.index = activeTab.index + 1
conf.dst.parentId = activeTab.parentId
}
} else if (Utils.isTabsPanel(panel)) {
conf.dst.index = Tabs.getIndexForNewTab(panel)
}
}

Expand Down

0 comments on commit 6d04fcc

Please sign in to comment.