From c93a1b7a145dd16cbdd70d619bdd114b840afa34 Mon Sep 17 00:00:00 2001 From: stereobooster Date: Tue, 12 Sep 2023 12:06:54 +0200 Subject: [PATCH] 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 = "";