Lektionen jetzt maximal 5000 Zeichen
This commit is contained in:
parent
848fca656b
commit
a546cfc3ec
2 changed files with 10 additions and 7 deletions
|
|
@ -698,9 +698,9 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
const currentLineIndex = getCurrentLineIndex();
|
||||
let newHTML = '';
|
||||
|
||||
// Zeige 10 Zeilen ab der aktuellen Zeile an
|
||||
const startLine = Math.max(0, currentLineIndex);
|
||||
const endLine = Math.min(lines.length, startLine + 10);
|
||||
// Zeige alle Zeilen an
|
||||
const startLine = 0;
|
||||
const endLine = lines.length;
|
||||
|
||||
// Berechne die Startposition jeder Zeile im Gesamttext
|
||||
let lineStarts = [];
|
||||
|
|
@ -753,9 +753,12 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
|
||||
targetTextElement.innerHTML = newHTML;
|
||||
|
||||
// Behalte Scroll-Position bei, es sei denn der Benutzer hat nicht manuell gescrollt
|
||||
// Scroll zur aktuellen Zeile, wenn der Benutzer nicht manuell gescrollt hat
|
||||
if (!userScrolled) {
|
||||
targetTextElement.scrollTop = 0;
|
||||
const currentLineElement = targetTextElement.querySelector('.current-line');
|
||||
if (currentLineElement) {
|
||||
currentLineElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,10 +59,10 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Textanzeige mit fester Höhe -->
|
||||
<!-- Textanzeige mit automatischer Höhe -->
|
||||
<div class="mb-4">
|
||||
<h5 class="card-title">Vorlage: <span id="lesson-title">{{ current_lesson_title }}</span></h5>
|
||||
<div id="target-text" class="border p-3 rounded" style="height: 200px; overflow: auto; white-space: pre-wrap; font-family: monospace;">
|
||||
<div id="target-text" class="border p-3 rounded" style="max-height: 200px; overflow: auto; white-space: pre-wrap; font-family: monospace;">
|
||||
<!-- Text wird zeilenweise durch JavaScript eingefügt -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue