mirror of
https://github.com/He4eT/tabswitcher.git
synced 2026-05-05 01:17:23 +00:00
pages/search: markup
This commit is contained in:
parent
3f644ee959
commit
2ace4fdd93
4 changed files with 46 additions and 34 deletions
|
|
@ -27,17 +27,9 @@ export const init = ({
|
|||
'url',
|
||||
].reduce((acc, x) => (acc[x] = tab[x], acc), {})
|
||||
|
||||
const addDisplayName = (tab) => ({
|
||||
displayName: `
|
||||
<span>${tab.label}</span>
|
||||
<span>${tab.title} / ${tab.url}</span>`,
|
||||
...tab,
|
||||
})
|
||||
|
||||
const shapeTabs = (tabs) => tabs
|
||||
.map(addLabel(tabs))
|
||||
.map(pickFields)
|
||||
.map(addDisplayName)
|
||||
|
||||
const fetchTabs = () =>
|
||||
browserTabs.query({ currentWindow: true, active: false })
|
||||
|
|
@ -51,7 +43,7 @@ export const init = ({
|
|||
state.results = fuzzysort.go(state.query, state.tabs, {
|
||||
keys: ['label', 'title', 'url'],
|
||||
all: true,
|
||||
}).map(({obj}) => obj)
|
||||
})
|
||||
}
|
||||
/* */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue