Learn: remember expanded sections, open only in the last chapter by default

This commit is contained in:
2026-09-17 20:41:54 +03:00
parent 930e2fb580
commit 51f0836894
3 changed files with 25 additions and 5 deletions

View File

@@ -47,12 +47,13 @@
</div>
<div class="card card-body chapter-card mb-4" data-section-list>
<div th:each="section : ${chapter.sections}" class="sub-acc" th:attr="data-section-id=${section.id}">
<div th:each="section : ${chapter.sections}" class="sub-acc collapsed"
th:attr="data-section-id=${section.id}">
<div class="sub-head sort-row">
<span th:if="${currentUser != null and currentUser.admin}" class="drag-handle" draggable="true"
th:attr="data-drag-kind='section',data-drag-id=${section.id}"
title="Перетащите мышью: изменить порядок разделов">⠿</span>
<button type="button" class="sub-toggle" aria-expanded="true" onclick="toggleSection(this)"
<button type="button" class="sub-toggle" aria-expanded="false" onclick="toggleSection(this)"
title="Свернуть или развернуть раздел">
<span class="sub-arrow" aria-hidden="true"></span>
</button>