summaryrefslogtreecommitdiffstats
path: root/modules-available/locations/templates/locations.html
diff options
context:
space:
mode:
authorSimon Rettberg2020-12-16 14:11:43 +0100
committerSimon Rettberg2020-12-16 14:11:43 +0100
commita40362564fa659ffa92d9ad9bd0ca164b592ff55 (patch)
tree03a27e80b52b46bd13ec1d3781d86f095089900f /modules-available/locations/templates/locations.html
parent[roomplanner] Remove duplicate files (diff)
downloadslx-admin-a40362564fa659ffa92d9ad9bd0ca164b592ff55.tar.gz
slx-admin-a40362564fa659ffa92d9ad9bd0ca164b592ff55.tar.xz
slx-admin-a40362564fa659ffa92d9ad9bd0ca164b592ff55.zip
[locations] Avoid potentially duplicate ids in ajax fragments
Diffstat (limited to 'modules-available/locations/templates/locations.html')
-rw-r--r--modules-available/locations/templates/locations.html8
1 files changed, 5 insertions, 3 deletions
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 @@
<span>{{locationname}}</span>
{{/show-only}}
{{^show-only}}
- <a id={{locationid}} href="#" onclick="slxOpenLocation(this, {{locationid}}); return false">
+ <a id="loc-{{locationid}}" href="#" onclick="slxOpenLocation(this, {{locationid}}); return false">
{{locationname}}
<b class="caret"></b>
</a>
@@ -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)
}
// -->