Buchansicht: am Anfang nicht zum Vorwort scrollen, mobile Knopfleiste bleibt oben

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
team3
2026-10-08 16:13:15 +02:00
parent 156d5fe69c
commit 94476bf56f
2 changed files with 3 additions and 2 deletions

View File

@@ -88,7 +88,8 @@ async function laden() {
spy()
// Gemerkte Position hat Vorrang (die Adresse spiegelt nur den letzten Scrollstand); zuletzt im Lesemodus gelesen → dessen Stelle
const ziel = idVonLesemodus(pos) || pos.abschnitt || idVonNr(props.nr)
if (ziel && !aktiv.value) document.getElementById(ziel)?.scrollIntoView({ block: 'start' })
// Am Buchanfang (Vorwort) nicht scrollen, damit Titel und Knopfleiste sichtbar bleiben
if (ziel && ziel !== 'vorwort' && !aktiv.value) document.getElementById(ziel)?.scrollIntoView({ block: 'start' })
}
watch(() => [props.slug, props.version], () => { aktiv.value = ''; cache.clear(); laden() }, { immediate: true })
// Zurück-Taste oder getippte Adresse: zum Abschnitt springen, wenn er nicht schon aktiv ist