diff options
author | tdro <tdro@noreply.example.com> | 2024-02-24 18:33:47 -0500 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2024-02-24 18:33:47 -0500 |
commit | e68fb9110dde654d5a830a110d20694352b6eaca (patch) | |
tree | 607b3040d0e85d5a8bba444fdd6890cf39006ebe /static | |
parent | 0681f6d1d7cff09835bb9ade250fbb490e3ede28 (diff) | |
download | canory-e68fb9110dde654d5a830a110d20694352b6eaca.tar.gz canory-e68fb9110dde654d5a830a110d20694352b6eaca.tar.bz2 canory-e68fb9110dde654d5a830a110d20694352b6eaca.zip |
themes/default/layouts/_default/home.xslt: Add scripts
Diffstat (limited to 'static')
-rw-r--r-- | static/js/fixedsearch.ts | 2 | ||||
-rw-r--r-- | static/js/update.ts | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/static/js/fixedsearch.ts b/static/js/fixedsearch.ts index 01dd917..f933dd7 100644 --- a/static/js/fixedsearch.ts +++ b/static/js/fixedsearch.ts @@ -42,6 +42,8 @@ let selected; + if (submit === null) return; + submit.addEventListener("click", function (event) { if (selected) { event.preventDefault(); diff --git a/static/js/update.ts b/static/js/update.ts index 94a509a..27b13b5 100644 --- a/static/js/update.ts +++ b/static/js/update.ts @@ -20,7 +20,9 @@ const remote = request.getResponseHeader("last-modified") || ''; const modified = Date.parse(document.lastModified) !== Date.parse(remote); const drift = Date.parse(remote || local) - Date.parse(local); + let indicator = document.querySelector("a[data-update]"); + if (indicator === null) return; const anchor = indicator.cloneNode(); function reset() { |