From f30522fbd4792140551b86e917bfd696ac79df49 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Wed, 3 Jan 2024 11:40:48 +0100 Subject: [PATCH] add autofocus to search field --- layouts/kontakt/list.html | 4 ++-- layouts/partials/head.html | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/layouts/kontakt/list.html b/layouts/kontakt/list.html index 05d5b5ea..3108ce07 100644 --- a/layouts/kontakt/list.html +++ b/layouts/kontakt/list.html @@ -1,8 +1,8 @@ {{ define "main" }} - + - +
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c7508c39..b252f67a 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -17,11 +17,16 @@ + {{ range .Site.Params.plugins.head_js }} + + {{ end }} + + }); - - {{ range .Site.Params.plugins.head_js }} - - {{ end }} + $('#search').addEventListener('shown.bs.modal', () => { + $('.pagefind-ui__search-input input').focus(); + }); + }); + })(jQuery); +