File tree Expand file tree Collapse file tree 3 files changed +19
-135
lines changed
src/main/js/components/header Expand file tree Collapse file tree 3 files changed +19
-135
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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+ }
17+
Original file line number Diff line number Diff line change 1- import computeActions from "@/components/header/actions-overflow " ;
1+ import updateActionsForTouch from "@/components/header/actions-touch " ;
22import computeBreadcrumbs from "@/components/header/breadcrumbs-overflow" ;
33
44function 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
6162function computeOverflow ( ) {
62- computeActions ( ) ;
6363 computeBreadcrumbs ( ) ;
6464}
6565
You can’t perform that action at this time.
0 commit comments