Skip to content

Commit

Permalink
💡 explain search domain matching
Browse files Browse the repository at this point in the history
  • Loading branch information
krmax44 authored Oct 9, 2023
1 parent 8610eed commit 959365f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/javascript/snippets/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ document
form.action = select.value
})

/*
the select has options like /documents/search/.
if the first path segment (here /documents/) of that url matches the
first path segment of the current window URL, select that option.
*/
const searchBases = [...select.querySelectorAll('option')].map((o) => [
firstPathSegment(o.value),
o.value
Expand Down

0 comments on commit 959365f

Please sign in to comment.