Content sort: autosave without reload; keep page state across reloads

- drag & drop now saves in the background (700 ms debounce) without reloading:
  sections stay open, scroll position is kept; on failure it retries every 3 s,
  and navigator.sendBeacon flushes unsaved changes on page leave
- removed the explicit save button (autosave only), status indicator shows
  «Изменения не сохранены… / Сохранение… / Порядок сохранён»
- new global ui-state.js: restores open <details> and scroll position after any
  reload/redirect within the same page (applies to all pages, not just /learn)
- auto-expand a collapsed chapter/section while hovering during drag
This commit is contained in:
2026-09-16 19:00:03 +03:00
parent 6ba5efa02d
commit d24e92005a
5 changed files with 157 additions and 21 deletions

View File

@@ -11,6 +11,7 @@
<script th:src="@{/js/htmx.min.js}" defer></script>
<script th:src="@{/js/highlight.min.js}" defer></script>
<script th:src="@{/js/tablekit.js}" defer></script>
<script th:src="@{/js/ui-state.js}" defer></script>
<script>
(function(){
var t = localStorage.getItem('lms-theme') || 'light';