mirror of https://github.com/docker/docs.git
Merge pull request #20868 from dvdksn/fix-prefill-searchqueryparam
fix: prefill query param on search
This commit is contained in:
commit
bb5bbf6b0d
|
@ -143,11 +143,11 @@
|
|||
for (let i = 1; i <= resultsLength / 10; i++) {
|
||||
if (i == currentPage) {
|
||||
resultsHTML += `<li class="text-center text-white">
|
||||
<a href="/search?q=${query}&page=${i}" class="block h-6 w-6 rounded-sm bg-blue-light dark:bg-blue-dark">${i}</a>
|
||||
<a href="{{ site.BaseURL }}search?q=${query}&page=${i}" class="block h-6 w-6 rounded-sm bg-blue-light dark:bg-blue-dark">${i}</a>
|
||||
</li>`;
|
||||
} else {
|
||||
resultsHTML += `<li class="text-center text-gray-light dark:text-gray-dark">
|
||||
<a href="/search?q=${query}&page=${i}" class="block h-6 w-6 rounded-sm bg-gray-light-200 dark:bg-gray-dark-200">${i}</a>
|
||||
<a href="{{ site.BaseURL }}search?q=${query}&page=${i}" class="block h-6 w-6 rounded-sm bg-gray-light-200 dark:bg-gray-dark-200">${i}</a>
|
||||
</li>`;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{{ (resources.Get "images/search-ai.svg").Content | safeHTML }}
|
||||
<input x-ref="searchBarInput" type="search" id="search-bar-input" @click="open = true" @focus="open = true;"
|
||||
@blur.window.capture="$refs.searchBarRef.contains($event.relatedTarget) || (open = false);"
|
||||
@keyup.enter.prevent="window.location.href = '/search?q=' + $event.target.value;"
|
||||
@keyup.enter.prevent="window.location.href = '{{ site.BaseURL }}search?q=' + $event.target.value;"
|
||||
@keyup.escape.prevent="open = false;" @keydown.window="(e) => {
|
||||
switch(e.key) {
|
||||
case 'k':
|
||||
|
|
Loading…
Reference in New Issue