Skip to content

Commit 8adbd0a

Browse files
committed
remove actions-overflow
1 parent 7c09e8a commit 8adbd0a

File tree

3 files changed

+18
-135
lines changed

3 files changed

+18
-135
lines changed

src/main/js/components/header/actions-overflow.js

Lines changed: 0 additions & 133 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default function updateActionsForTouch() {
2+
// We want to disable the User action href on touch devices so that they can still activate the overflow menu
3+
const link = document.querySelector("#root-action-UserAction");
4+
5+
if (link) {
6+
const originalHref = link.getAttribute("href");
7+
const isTouchDevice = window.matchMedia("(hover: none)").matches;
8+
9+
// HTMLUnit doesn't register itself as supporting hover, thus the href is removed when it shouldn't be
10+
if (isTouchDevice && !window.isRunAsTest) {
11+
link.removeAttribute("href");
12+
} else {
13+
link.setAttribute("href", originalHref);
14+
}
15+
}
16+
}

src/main/js/components/header/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import computeActions from "@/components/header/actions-overflow";
1+
import updateActionsForTouch from "@/components/header/actions-touch";
22
import computeBreadcrumbs from "@/components/header/breadcrumbs-overflow";
33

44
function init() {
55
// Recompute what actions and breadcrumbs should be visible when the viewport size is changed
66
computeOverflow();
7+
updateActionsForTouch();
78
let lastWidth = window.innerWidth;
89
window.addEventListener("resize", () => {
910
if (window.innerWidth !== lastWidth) {
@@ -59,7 +60,6 @@ function init() {
5960
}
6061

6162
function computeOverflow() {
62-
computeActions();
6363
computeBreadcrumbs();
6464
}
6565

0 commit comments

Comments
 (0)