Skip to content

Commit

Permalink
feat: Init search on first render popup
Browse files Browse the repository at this point in the history
  • Loading branch information
oodamien committed Jan 26, 2024
1 parent a824cbe commit c7fc949
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/js/vendor/search.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

;(function () {
const isMac = () => navigator.platform.indexOf('Mac') > -1

let loaded = false
const config = document.getElementById('search-script').dataset
const client = algoliasearch(config.appId, config.apiKey)
let selected = null
Expand Down Expand Up @@ -222,9 +222,11 @@
}),
])

search.start()

const open = () => {
if (!loaded) {
search.start()
loaded = true
}
selectHit(null)
MicroModal.show('modal-1', {
disableScroll: true,
Expand Down

0 comments on commit c7fc949

Please sign in to comment.