From fc4120662a0758e8a1674f4b261261bf0afa3a9b Mon Sep 17 00:00:00 2001 From: stereobooster Date: Tue, 12 Sep 2023 12:06:54 +0200 Subject: [PATCH 1/2] Small improvement in js --- assets/js/search.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/assets/js/search.js b/assets/js/search.js index e5f88047..7a17e742 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -133,21 +133,19 @@ function executeQuery(term) { let resultsHTML = ""; if (results.length > 0) { - results.forEach(function (value, key) { - resultsHTML = - resultsHTML + - `
  • - -
    -
    ${value.item.title}
    -
    ${value.item.section}${value.item.date == null ? '' : `·${value.item.date}`}
    -
    ${value.item.summary}
    -
    -
    -
    -
    -
  • `; - }); + resultsHTML = results.forEach(function (value, key) { + return `
  • + +
    +
    ${value.item.title}
    +
    ${value.item.section}${value.item.date == null ? '' : `·${value.item.date}`}
    +
    ${value.item.summary}
    +
    +
    +
    +
    +
  • `; + }).join(""); hasResults = true; } else { resultsHTML = ""; From 0e697b27caf9a410f17ae91eb851317648342e1f Mon Sep 17 00:00:00 2001 From: stereobooster Date: Mon, 23 Oct 2023 02:04:13 +0200 Subject: [PATCH 2/2] fix --- assets/js/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/search.js b/assets/js/search.js index 7a17e742..4a47ba58 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -133,7 +133,7 @@ function executeQuery(term) { let resultsHTML = ""; if (results.length > 0) { - resultsHTML = results.forEach(function (value, key) { + resultsHTML = results.map(function (value, key) { return `