From a40362564fa659ffa92d9ad9bd0ca164b592ff55 Mon Sep 17 00:00:00 2001
From: Simon Rettberg
Date: Wed, 16 Dec 2020 14:11:43 +0100
Subject: [locations] Avoid potentially duplicate ids in ajax fragments
---
modules-available/locations/templates/locations.html | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
(limited to 'modules-available/locations/templates/locations.html')
diff --git a/modules-available/locations/templates/locations.html b/modules-available/locations/templates/locations.html
index 2f4af8af..125c101a 100644
--- a/modules-available/locations/templates/locations.html
+++ b/modules-available/locations/templates/locations.html
@@ -55,7 +55,7 @@
{{locationname}}
{{/show-only}}
{{^show-only}}
-
+
{{locationname}}
@@ -170,7 +170,7 @@ var newRowCounter = 0;
document.addEventListener("DOMContentLoaded", function() {
var id = window.location.hash.substring(1);
if (id !== "") {
- var loc_dom = document.getElementById(id);
+ var loc_dom = document.getElementById("loc-" + id);
slxOpenLocation(loc_dom, id);
}
});
@@ -260,7 +260,9 @@ function deleteSubnetWarning(locid) {
}
function loadOpeningTimes(locid) {
- $("#openingTimesModal" + locid).find('.modal-body').load("?do=Locations&page=details&action=getOpeningtimes&locid=" + locid)
+ var $e = $("#openingTimesModal" + locid).find('.modal-body');
+ if (!$e.is(':empty')) return;
+ $e.load("?do=Locations&page=details&action=getOpeningtimes&locid=" + locid)
}
// -->
--
cgit v1.2.3-55-g7522