Skip to content

Commit b2f206f

Browse files
authored
Merge pull request #11 from Selphira/main
L'en-tête de la catégorie en cours d'affichage reste affichée.
2 parents cbf23c4 + ada5b04 commit b2f206f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

docs/static/css/list.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,12 @@ section {
331331
background: var(--background-secondary);
332332
}
333333

334+
summary.category_name {
335+
position: sticky;
336+
top: 102px;
337+
z-index: 5;
338+
}
339+
334340
.table .category_container .category_name::after {
335341
content: " (" attr(data-count) ")";
336342
}

docs/static/js/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,10 @@ document.addEventListener("DOMContentLoaded", function () {
125125
function adjustScroll(hash) {
126126
let target = document.querySelector(hash)
127127
if (target) {
128-
let offset = document.querySelector("#search_text").offsetHeight
128+
let offsetSearch = document.querySelector("#search_text").offsetHeight
129+
let offsetCategory = document.querySelector("summary.category_name").offsetHeight
129130
window.scrollTo({
130-
top: target.offsetTop - offset - 5,
131+
top: target.offsetTop - offsetSearch - offsetCategory - 1,
131132
behavior: "smooth"
132133
})
133134
}

0 commit comments

Comments
 (0)