mirror of https://github.com/jenkinsci/jenkins.git
[JENKINS-75834] limit the functionality to a specific reference (#10818)
This commit is contained in:
commit
3a97ed4f79
|
@ -36,15 +36,21 @@ function dropdown() {
|
||||||
animation: "dropdown",
|
animation: "dropdown",
|
||||||
duration: 250,
|
duration: 250,
|
||||||
onShow: (instance) => {
|
onShow: (instance) => {
|
||||||
// Make sure only one instance is visible at all times
|
// Make sure only one instance is visible at all times in case of breadcrumb
|
||||||
const dropdowns = document.querySelectorAll("[data-tippy-root]");
|
if (
|
||||||
Array.from(dropdowns).forEach((element) => {
|
instance.reference.classList.contains("hoverable-model-link") ||
|
||||||
// Check if the Tippy.js instance exists
|
instance.reference.classList.contains("hoverable-children-model-link")
|
||||||
if (element && element._tippy) {
|
) {
|
||||||
// To just hide the dropdown
|
const dropdowns = document.querySelectorAll("[data-tippy-root]");
|
||||||
element._tippy.hide();
|
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;
|
const referenceParent = instance.reference.parentNode;
|
||||||
|
|
||||||
if (referenceParent.classList.contains("model-link")) {
|
if (referenceParent.classList.contains("model-link")) {
|
||||||
|
|
Loading…
Reference in New Issue