From 29d29288a09bde0ccbcb9f7c86df69192f0de0e3 Mon Sep 17 00:00:00 2001 From: Gustavo Luigi <=> Date: Tue, 1 Aug 2023 16:58:48 -0300 Subject: [PATCH] . --- assets/home/script.js | 6 +++--- content/index.blade.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/home/script.js b/assets/home/script.js index f606c83..bbb8ea1 100644 --- a/assets/home/script.js +++ b/assets/home/script.js @@ -54,7 +54,7 @@ function initMap() { let infowindowElement = $("#marker-window").clone(); infowindowElement.html(infowindowElement.html().replace('$title', item.title)); infowindowElement.html(infowindowElement.html().replace('$description', item.description ?? '')); - infowindowElement.html(infowindowElement.html().replace('data-href="$path"', 'href="' + item.path + '"')); + infowindowElement.find(".path").attr("href", item.path); infowindowElement.removeClass('d-none'); return infowindowElement[0].outerHTML; } @@ -143,7 +143,7 @@ function initMap() { let locationElement = locationElementTemplate.clone(); locationElement.html(locationElement.html().replace('$title', item.title)); locationElement.html(locationElement.html().replace('data-src="$image"', 'src="' + item.image + '"')); - locationElement.html(locationElement.html().replace('data-href="$path"', 'href="' + item.path + '"')); + locationElement.find(".path").attr("href", item.path); let location = item[textToSlug(locationField)]; if (location && location.postalCode) locationElement.html(locationElement.html().replace('$postalCode', (location.postalCode + " " + (location.addressLocality ?? "")).trim())); @@ -151,7 +151,7 @@ function initMap() { locationElement.removeClass('d-none'); - if (item[textToSlug(tagField)]) item[textToSlug(tagField)].slice(0, 2).forEach(function (besonderheitenItem) { + if (item[textToSlug(tagField)] && Array.isArray(item[textToSlug(tagField)])) item[textToSlug(tagField)].slice(0, 2).forEach(function (besonderheitenItem) { locationElement.find(".tags").append(`${besonderheitenItem}`); }); diff --git a/content/index.blade.php b/content/index.blade.php index c6e4e55..b2f7963 100644 --- a/content/index.blade.php +++ b/content/index.blade.php @@ -113,7 +113,7 @@

$description

- Details + Details