[JENKINS-75834] limit the functionality to a specific reference (#10818)
Changelog Drafter / update_draft_release (push) Waiting to run Details
Changelog Drafter / jenkins_io_draft (push) Waiting to run Details
Label conflicting PRs / main (push) Waiting to run Details

This commit is contained in:
Mark Waite 2025-07-10 08:19:53 -06:00 committed by GitHub
commit 3a97ed4f79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 9 deletions

View File

@ -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")) {