Skip to content

Commit 73c2030

Browse files
Highlight related sidebar row when result .entry is hovered
1 parent eb2e484 commit 73c2030

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

public/css/schedule.less

+15-7
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,20 @@
5858

5959
/* Design */
6060

61-
.schedule .entry.highlighted {
62-
outline: 2px solid var(--entry-border-color);
63-
outline-offset: 1px;
64-
}
61+
.schedule {
62+
.entry.highlighted {
63+
outline: 2px solid var(--entry-border-color);
64+
outline-offset: 1px;
65+
}
6566

66-
.schedule .step.highlighted {
67-
background-color: @gray-lighter;
68-
border-color: @gray-light;
67+
.sidebar .row-title.highlighted,
68+
.step.highlighted {
69+
background-color: @gray-lighter;
70+
border-color: @gray-light;
71+
}
72+
73+
.sidebar .row-title.highlighted {
74+
margin-top: -1px; // cover the border-top area
75+
padding-top: 1px;
76+
}
6977
}

public/js/schedule.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,15 @@
7979
const entry = event.currentTarget;
8080
const overlay = entry.parentElement;
8181
const grid = overlay.previousSibling;
82+
const sideBar = grid.previousSibling;
8283

8384
let relatedElements;
8485
if ('rotationPosition' in entry.dataset) {
85-
relatedElements = grid.querySelectorAll(
86-
'[data-y-position="' + entry.dataset.rotationPosition + '"]'
86+
relatedElements = Array.from(
87+
grid.querySelectorAll('[data-y-position="' + entry.dataset.rotationPosition + '"]')
8788
);
89+
90+
relatedElements.push(sideBar.childNodes[Number(entry.dataset.rotationPosition)]);
8891
} else {
8992
relatedElements = overlay.querySelectorAll(
9093
'[data-rotation-position="' + entry.dataset.entryPosition + '"]'
@@ -101,12 +104,15 @@
101104
const entry = event.currentTarget;
102105
const overlay = entry.parentElement;
103106
const grid = overlay.previousSibling;
107+
const sideBar = grid.previousSibling;
104108

105109
let relatedElements;
106110
if ('rotationPosition' in entry.dataset) {
107-
relatedElements = grid.querySelectorAll(
108-
'[data-y-position="' + entry.dataset.rotationPosition + '"]'
111+
relatedElements = Array.from(
112+
grid.querySelectorAll('[data-y-position="' + entry.dataset.rotationPosition + '"]')
109113
);
114+
115+
relatedElements.push(sideBar.childNodes[Number(entry.dataset.rotationPosition)]);
110116
} else {
111117
relatedElements = overlay.querySelectorAll(
112118
'[data-rotation-position="' + entry.dataset.entryPosition + '"]'

0 commit comments

Comments
 (0)