Skip to content

Commit 9c3ed1c

Browse files
Highlight related sidebar row when result .entry is hovered
1 parent 2a8b216 commit 9c3ed1c

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

public/css/schedule.less

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,20 @@
5454

5555
/* Design */
5656

57-
.schedule-detail .entry.highlighted {
58-
outline: 2px solid var(--entry-border-color);
59-
outline-offset: 1px;
60-
}
57+
.schedule {
58+
.entry.highlighted {
59+
outline: 2px solid var(--entry-border-color);
60+
outline-offset: 1px;
61+
}
6162

62-
.schedule-detail .step.highlighted {
63-
background-color: @gray-lighter;
64-
border-color: @gray-light;
63+
.sidebar .row-title.highlighted,
64+
.step.highlighted {
65+
background-color: @gray-lighter;
66+
border-color: @gray-light;
67+
}
68+
69+
.sidebar .row-title.highlighted {
70+
margin-top: -1px; // cover the border-top area
71+
padding-top: 1px;
72+
}
6573
}

public/js/schedule.js

Lines changed: 10 additions & 4 deletions
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)