From 30d33a9eedca8ae4b2e6082b915579c309f8b52c Mon Sep 17 00:00:00 2001 From: tdro Date: Sat, 13 Jan 2024 20:33:21 -0500 Subject: static/js: Prepare custom URL changed event Set key on pager and always clear interval --- static/js/fixedsearch.ts | 30 ++++++++++++++--------------- static/js/pager.ts | 49 ++++++++++++++++++++++++++---------------------- static/js/timeago.ts | 15 ++++++++------- 3 files changed, 49 insertions(+), 45 deletions(-) (limited to 'static') diff --git a/static/js/fixedsearch.ts b/static/js/fixedsearch.ts index 0a7e9da..1e44601 100644 --- a/static/js/fixedsearch.ts +++ b/static/js/fixedsearch.ts @@ -4,7 +4,8 @@ */ (function () { - self.addEventListener("DOMContentLoaded", function () { + ["DOMContentLoaded", "URLChangedCustomEvent"].forEach(function (event) { + self.addEventListener(event, function () { const form = document.getElementById("search-form"); // targets
const query = document.getElementById("search-input"); // targets const submit = document.getElementById("search-submit"); // targets