mirror of
https://github.com/He4eT/tabswitcher.git
synced 2026-05-05 01:17:23 +00:00
pages/search: actions: extract tab to popup
This commit is contained in:
parent
60d28b9970
commit
194c1fa2bc
3 changed files with 18 additions and 1 deletions
|
|
@ -19,7 +19,7 @@ export const actionboxHandlers = (commandQuery, store, flush) => {
|
|||
'c': duplicateTab,
|
||||
's': discardTab,
|
||||
'p': pinOrUnpinTab,
|
||||
// 'e': Pop the tab into it's own window with minimal UI
|
||||
'e': moveTabToPopup,
|
||||
}[command] ?? noop(command))(store, label, flush)
|
||||
}
|
||||
|
||||
|
|
@ -78,6 +78,15 @@ function duplicateTab (store, label, flush) {
|
|||
}
|
||||
}
|
||||
|
||||
function moveTabToPopup (store, label, flush) {
|
||||
const tab = getTabByLabel(store, label)
|
||||
if (tab) {
|
||||
flush()
|
||||
store.actions.moveTabToPopup(tab.id)
|
||||
store.actions.closeCurrentTab()
|
||||
}
|
||||
}
|
||||
|
||||
function pinOrUnpinTab (store, label, flush) {
|
||||
const tab = getTabByLabel(store, label)
|
||||
if (tab) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ const fuzzysort = window.fuzzysort
|
|||
|
||||
export const init = ({
|
||||
tabs: browserTabs,
|
||||
windows: browserWindows,
|
||||
onStateUpdate,
|
||||
closeCurrentTab,
|
||||
}) => {
|
||||
|
|
@ -94,6 +95,12 @@ export const init = ({
|
|||
browserTabs.discard(id)
|
||||
.then(updateState)
|
||||
},
|
||||
moveTabToPopup(id) {
|
||||
browserWindows.create({
|
||||
tabId: id,
|
||||
type: 'popup',
|
||||
}).then(updateState)
|
||||
},
|
||||
updateTab(id, options) {
|
||||
browserTabs.update(id, options)
|
||||
.then(updateState)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue