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