Skip to content

Commit

Permalink
Update actions-overflow.js
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Feb 8, 2025
1 parent cadf01e commit f740741
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/main/js/components/header/actions-overflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ export default function computeActions() {

while (actionsOverflows()) {
const item = actions.pop();

if (!item) {
break;
}

items.unshift(item);
item.classList.add("jenkins-hidden");
}
Expand Down Expand Up @@ -55,13 +60,16 @@ export default function computeActions() {

// We want to disable the User action href on touch devices so that they can still activate the overflow menu
const link = document.querySelector("#root-action-UserAction");
const originalHref = link.getAttribute("href");
const isTouchDevice = window.matchMedia("(hover: none)").matches;

if (isTouchDevice) {
link.removeAttribute("href");
} else {
link.setAttribute("href", originalHref);
if (link) {
const originalHref = link.getAttribute("href");
const isTouchDevice = window.matchMedia("(hover: none)").matches;

if (isTouchDevice) {
link.removeAttribute("href");
} else {
link.setAttribute("href", originalHref);
}
}
}

Expand Down

0 comments on commit f740741

Please sign in to comment.