[JENKINS-75834] limit the functionality to a specific reference (#10818)

This commit is contained in:
Mark Waite authored and GitHub committed 2025-07-10 08:19:53 -06:00
commit 3a97ed4f79
1 file changed
+15 -9
+15 -9
View File
@@ -36,15 +36,21 @@ function dropdown() {
animation: "dropdown",
duration: 250,
onShow: (instance) => {
// Make sure only one instance is visible at all times
const dropdowns = document.querySelectorAll("[data-tippy-root]");
Array.from(dropdowns).forEach((element) => {
// Check if the Tippy.js instance exists
if (element && element._tippy) {
// To just hide the dropdown
element._tippy.hide();
}
});
// Make sure only one instance is visible at all times in case of breadcrumb
if (
instance.reference.classList.contains("hoverable-model-link") ||
instance.reference.classList.contains("hoverable-children-model-link")
) {
const dropdowns = document.querySelectorAll("[data-tippy-root]");
Array.from(dropdowns).forEach((element) => {
// Check if the Tippy.js instance exists
if (element && element._tippy) {
// To just hide the dropdown
element._tippy.hide();
}
});
}
const referenceParent = instance.reference.parentNode;
if (referenceParent.classList.contains("model-link")) {