diff options
author | 2021-05-03 12:26:10 -0600 | |
---|---|---|
committer | 2021-05-03 12:26:10 -0600 | |
commit | 94038d329705acb79a0f804458821d43f59121db (patch) | |
tree | 0f11c52b13a6de9344a83c900466b1bceb888bbe /examples/snowpack/src/components/docsearch.js | |
parent | c93201a909105bb0ef75278d9635de4b5b8734e7 (diff) | |
download | astro-94038d329705acb79a0f804458821d43f59121db.tar.gz astro-94038d329705acb79a0f804458821d43f59121db.tar.zst astro-94038d329705acb79a0f804458821d43f59121db.zip |
Format (#167)
Diffstat (limited to 'examples/snowpack/src/components/docsearch.js')
-rw-r--r-- | examples/snowpack/src/components/docsearch.js | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/examples/snowpack/src/components/docsearch.js b/examples/snowpack/src/components/docsearch.js index d7ae95f30..f2b9e6441 100644 --- a/examples/snowpack/src/components/docsearch.js +++ b/examples/snowpack/src/components/docsearch.js @@ -1,17 +1,20 @@ import docsearch from 'docsearch.js/dist/cdn/docsearch.min.js'; -customElements.define('doc-search', class extends HTMLElement { - connectedCallback() { - if(!this._setup) { - const apiKey = this.getAttribute('api-key'); - const selector = this.getAttribute('selector'); - docsearch({ - apiKey: apiKey, - indexName: 'snowpack', - inputSelector: selector, - debug: true // Set debug to true if you want to inspect the dropdown - }); - this._setup = true; +customElements.define( + 'doc-search', + class extends HTMLElement { + connectedCallback() { + if (!this._setup) { + const apiKey = this.getAttribute('api-key'); + const selector = this.getAttribute('selector'); + docsearch({ + apiKey: apiKey, + indexName: 'snowpack', + inputSelector: selector, + debug: true, // Set debug to true if you want to inspect the dropdown + }); + this._setup = true; + } } - } -});
\ No newline at end of file + }, +); |