mirror of
https://github.com/He4eT/tabswitcher.git
synced 2026-05-04 17:07:23 +00:00
pages/search: input handlers: init
This commit is contained in:
parent
f5af3c1823
commit
499bd4dceb
2 changed files with 11 additions and 0 deletions
8
pages/search/modules/inputHandlers.js
Normal file
8
pages/search/modules/inputHandlers.js
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
export const attachInputHandlers = (store) => {
|
||||||
|
const searchBox = document.getElementById('searchbox')
|
||||||
|
const actionbox = document.getElementById('actionbox')
|
||||||
|
|
||||||
|
searchBox.addEventListener('input', (e) => {
|
||||||
|
store.actions.updateQuery(e.target.value)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
import * as Store from './modules/store.js'
|
import * as Store from './modules/store.js'
|
||||||
import * as dom from './modules/dom.js'
|
import * as dom from './modules/dom.js'
|
||||||
|
import * as inputHandlers from './modules/inputHandlers.js'
|
||||||
|
|
||||||
const store = Store.init({
|
const store = Store.init({
|
||||||
tabs: browser.tabs,
|
tabs: browser.tabs,
|
||||||
onStateUpdate: dom.updateSearchResults,
|
onStateUpdate: dom.updateSearchResults,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
void inputHandlers.attachInputHandlers(store)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue