From 53a73746591479dc7c3e075dc01191595f83f1cd Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Sun, 22 Jun 2025 14:29:22 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20Update=20loading=20spinner=20to?= =?UTF-8?q?=20take=20currentColor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + assets/js/search.js | 41 ++++++++++++++++++++--------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f314c10..73859d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added +- Loading spinner while populating search results ([#1025](https://github.com/jpanther/congo/pull/1025)) - New `canonicalUrl` parameter support in article front matter ([#1046](https://github.com/jpanther/congo/pull/1046)) - New icons for `goodreads`, `podcast` and `rss` ([#1057](https://github.com/jpanther/congo/pull/1057), [#1072](https://github.com/jpanther/congo/pull/1072)) diff --git a/assets/js/search.js b/assets/js/search.js index e8955f3..ed0d6db 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -74,40 +74,40 @@ input.onkeyup = function (event) { - + - + - + - + - + - + - + - + - + - + - + - + @@ -119,15 +119,15 @@ input.onkeyup = function (event) { }; function throttle(func, time = 750) { - let isFirstRun = throttle.timeout === undefined + let isFirstRun = throttle.timeout === undefined; if (!isFirstRun) { - clearTimeout(throttle.timeout) + clearTimeout(throttle.timeout); } throttle.timeout = setTimeout(() => { - func() - throttle.timeout = undefined - }, time) - return isFirstRun + func(); + throttle.timeout = undefined; + }, time); + return isFirstRun; } function displaySearch() { @@ -210,8 +210,7 @@ function executeQuery(term) { first = output.firstChild.firstElementChild; last = output.lastChild.firstElementChild; - } - else { - output.innerHTML = "" + } else { + output.innerHTML = ""; } }