summaryrefslogtreecommitdiff
path: root/examples/snowpack/src/components/docsearch.js
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-05-03 12:26:10 -0600
committerGravatar GitHub <noreply@github.com> 2021-05-03 12:26:10 -0600
commit94038d329705acb79a0f804458821d43f59121db (patch)
tree0f11c52b13a6de9344a83c900466b1bceb888bbe /examples/snowpack/src/components/docsearch.js
parentc93201a909105bb0ef75278d9635de4b5b8734e7 (diff)
downloadastro-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.js31
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
+ },
+);