Skip to content

Commit 19deebd

Browse files
authored
fixing the popover behavior, so it doesn't show as transparent, because later rows are in the front (#54)
Signed-off-by: Kai Wagner <[email protected]>
1 parent cc033f8 commit 19deebd

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

app/assets/stylesheets/components/topics.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ a.topic-icon {
293293
}
294294
}
295295

296+
.topic-row.is-popover-open {
297+
position: relative;
298+
z-index: 5;
299+
}
300+
296301
.topic-row.topic-new,
297302
.topic-row.topic-reading {
298303
background: var(--color-bg-unread);

app/javascript/controllers/hover_popover_controller.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ export default class extends Controller {
1313
show() {
1414
this._clearTimeout()
1515
this.element.classList.add("is-open")
16+
this._updateRowOpenState()
1617
}
1718

1819
scheduleHide() {
1920
this._clearTimeout()
2021
this.hideTimeout = setTimeout(() => {
2122
this.element.classList.remove("is-open")
23+
this._updateRowOpenState()
2224
}, this.delay)
2325
}
2426

@@ -28,4 +30,12 @@ export default class extends Controller {
2830
this.hideTimeout = null
2931
}
3032
}
33+
34+
_updateRowOpenState() {
35+
const row = this.element.closest(".topic-row")
36+
if (!row) return
37+
38+
const hasOpenPopover = row.querySelector(".topic-icon.is-open")
39+
row.classList.toggle("is-popover-open", Boolean(hasOpenPopover))
40+
}
3141
}

0 commit comments

Comments
 (0)