add autofocus to search field
This commit is contained in:
parent
cbbf5abf04
commit
f30522fbd4
@ -1,8 +1,8 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@^1.7.1/dist/leaflet.css" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.min.css" />
|
||||
|
||||
<script src="https://unpkg.com/leaflet@^1.7.1/dist/leaflet.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.min.js"></script>
|
||||
|
||||
<main data-pagefind-body>
|
||||
<section class="section pb-0">
|
||||
|
@ -17,11 +17,16 @@
|
||||
<link rel="shortcut icon" href="{{ `media/favicon.png` | absURL }}" type="image/x-icon">
|
||||
<link rel="icon" href="{{ `media/favicon.png` | absURL }}" type="image/x-icon">
|
||||
|
||||
{{ range .Site.Params.plugins.head_js }}
|
||||
<script src="{{ . | absURL }}" type="text/javascript"></script>
|
||||
{{ end }}
|
||||
|
||||
<link href="/pagefind/pagefind-ui.css" rel="stylesheet">
|
||||
<script src="/pagefind/pagefind-ui.js" type="text/javascript"></script>
|
||||
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', (event) => {
|
||||
($ => {
|
||||
$(window).on('DOMContentLoaded', () => {
|
||||
new PagefindUI({
|
||||
element: "#search",
|
||||
translations: {
|
||||
@ -29,14 +34,14 @@
|
||||
zero_results: "Leider konnten keine Ergebnisse zu [SEARCH_TERM] gefunden werden",
|
||||
clear_search: "Löschen"
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
});
|
||||
|
||||
|
||||
{{ range .Site.Params.plugins.head_js }}
|
||||
<script src="{{ . | absURL }}"></script>
|
||||
{{ end }}
|
||||
$('#search').addEventListener('shown.bs.modal', () => {
|
||||
$('.pagefind-ui__search-input input').focus();
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var _paq = window._paq = window._paq || [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user