Skip to content

Commit 3a97ed4

Browse files
authored
[JENKINS-75834] limit the functionality to a specific reference (#10818)
2 parents 2098814 + 62dbda9 commit 3a97ed4

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/main/js/components/dropdowns/templates.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,21 @@ function dropdown() {
3636
animation: "dropdown",
3737
duration: 250,
3838
onShow: (instance) => {
39-
// Make sure only one instance is visible at all times
40-
const dropdowns = document.querySelectorAll("[data-tippy-root]");
41-
Array.from(dropdowns).forEach((element) => {
42-
// Check if the Tippy.js instance exists
43-
if (element && element._tippy) {
44-
// To just hide the dropdown
45-
element._tippy.hide();
46-
}
47-
});
39+
// Make sure only one instance is visible at all times in case of breadcrumb
40+
if (
41+
instance.reference.classList.contains("hoverable-model-link") ||
42+
instance.reference.classList.contains("hoverable-children-model-link")
43+
) {
44+
const dropdowns = document.querySelectorAll("[data-tippy-root]");
45+
Array.from(dropdowns).forEach((element) => {
46+
// Check if the Tippy.js instance exists
47+
if (element && element._tippy) {
48+
// To just hide the dropdown
49+
element._tippy.hide();
50+
}
51+
});
52+
}
53+
4854
const referenceParent = instance.reference.parentNode;
4955

5056
if (referenceParent.classList.contains("model-link")) {

0 commit comments

Comments
 (0)