From f6d2292b997613b497c15783dd36989588fbfbc0 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 15 Sep 2024 22:54:55 +0200 Subject: [PATCH] fixup! Use Pagefind's UI for the full search --- static/js/application.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/static/js/application.js b/static/js/application.js index 40d8d0886f..51a62175dd 100644 --- a/static/js/application.js +++ b/static/js/application.js @@ -360,9 +360,10 @@ var Search = { const language = this.getQueryValue('language'); - new PagefindUI({ + const ui = new PagefindUI({ element: "#search-div", showSubResults: true, + showImages: false, language, ranking: { pageLength: 0.1, // boost longer pages @@ -378,8 +379,8 @@ var Search = { const searchTerm = this.getQueryValue('search'); if (searchTerm) { - // TODO: figure out how to use `trigger()` instead of `[0].dispatchEvent()` - $("#search-div input").val(searchTerm)[0].dispatchEvent(new Event("input")) + $("#search-div input").val(searchTerm) + ui.triggerSearch(searchTerm); } } }