From 67835aae59b34cab821cf2bade5cf39ebb3053e0 Mon Sep 17 00:00:00 2001 From: Beatrycze Volk Date: Mon, 16 Dec 2024 19:39:47 +0100 Subject: [PATCH] [BUGFIX] Fix highlighting for words (#1377) Co-authored-by: Sebastian Meyer --- Resources/Public/JavaScript/PageView/Utility.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Resources/Public/JavaScript/PageView/Utility.js b/Resources/Public/JavaScript/PageView/Utility.js index 15cb4bcc9..c70b9d4d6 100644 --- a/Resources/Public/JavaScript/PageView/Utility.js +++ b/Resources/Public/JavaScript/PageView/Utility.js @@ -646,16 +646,16 @@ dlfUtils.scaleToImageSize = function (features, imageObj, width, height, optOffs }; /** - * Search a feature collection for a feature with the given coordinates + * Search a feature collection for a feature with the given word in its fulltext * @param {Array.} featureCollection - * @param {string} coordinates + * @param {string} word for highlighting * @returns {Array.|undefined} */ -dlfUtils.searchFeatureCollectionForCoordinates = function (featureCollection, coordinates) { +dlfUtils.searchFeatureCollectionForCoordinates = function (featureCollection, word) { var features = []; featureCollection.forEach(function (ft) { if (ft.values_.fulltext !== undefined) { - if (ft.values_.fulltext.includes(coordinates)) { + if (ft.values_.fulltext.toLowerCase().includes(word.toLowerCase())) { features.push(ft); } }