pages/search: actions: extract tab to popup

This commit is contained in:
He4eT 2024-01-21 22:08:45 +01:00
commit 194c1fa2bc
3 changed files with 18 additions and 1 deletions

View file

@ -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) {