mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Ran prettier
This commit is contained in:
parent
ee1d7983ba
commit
d0237187c4
1 changed files with 6 additions and 7 deletions
|
|
@ -188,9 +188,8 @@ class NavigationSearch extends HTMLElement {
|
||||||
setupEventListeners() {
|
setupEventListeners() {
|
||||||
const dialog = this.shadowRoot.querySelector("dialog");
|
const dialog = this.shadowRoot.querySelector("dialog");
|
||||||
const input = this.shadowRoot.querySelector(".search-input");
|
const input = this.shadowRoot.querySelector(".search-input");
|
||||||
const resultsContainer = this.shadowRoot.querySelector(
|
const resultsContainer =
|
||||||
".results-container"
|
this.shadowRoot.querySelector(".results-container");
|
||||||
);
|
|
||||||
|
|
||||||
// Global keyboard listener for "/"
|
// Global keyboard listener for "/"
|
||||||
document.addEventListener("keydown", (e) => {
|
document.addEventListener("keydown", (e) => {
|
||||||
|
|
@ -304,7 +303,7 @@ class NavigationSearch extends HTMLElement {
|
||||||
this.matches = (this.allItems || []).filter(
|
this.matches = (this.allItems || []).filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
item.name.toLowerCase().includes(lowerQuery) ||
|
item.name.toLowerCase().includes(lowerQuery) ||
|
||||||
item.url.toLowerCase().includes(lowerQuery)
|
item.url.toLowerCase().includes(lowerQuery),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
this.selectedIndex = this.matches.length > 0 ? 0 : -1;
|
this.selectedIndex = this.matches.length > 0 ? 0 : -1;
|
||||||
|
|
@ -336,12 +335,12 @@ class NavigationSearch extends HTMLElement {
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div class="result-name">${this.escapeHtml(
|
<div class="result-name">${this.escapeHtml(
|
||||||
match.name
|
match.name,
|
||||||
)}</div>
|
)}</div>
|
||||||
<div class="result-url">${this.escapeHtml(match.url)}</div>
|
<div class="result-url">${this.escapeHtml(match.url)}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`
|
`,
|
||||||
)
|
)
|
||||||
.join("");
|
.join("");
|
||||||
|
|
||||||
|
|
@ -377,7 +376,7 @@ class NavigationSearch extends HTMLElement {
|
||||||
detail: match,
|
detail: match,
|
||||||
bubbles: true,
|
bubbles: true,
|
||||||
composed: true,
|
composed: true,
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Navigate to URL
|
// Navigate to URL
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue