From 762663a3f6c0c48406248fb823173861f781af9a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 24 Feb 2022 16:38:10 +0100 Subject: [PATCH] utils.js: Use jQuery to check id uniqueness --- public/js/icinga/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/js/icinga/utils.js b/public/js/icinga/utils.js index 0168b97b9..207750617 100644 --- a/public/js/icinga/utils.js +++ b/public/js/icinga/utils.js @@ -374,7 +374,10 @@ var id = element.id; // Only use ids if they're truly unique - if (!! id && document.querySelectorAll('* #' + id).length === 1) { + // TODO: The check used to use document.querySelectorAll, but this resulted in many issues with ids + // that start with a decimal. jQuery seems to escape those correctly, so this is the only reason + // why it's still.. jQuery. + if (!! id && $('* #' + id).length === 1) { path.push('#' + id); break; }