Matrix-Chat beim Laden automatisch zur neuesten Nachricht scrollen

This commit is contained in:
Kai
2026-02-17 18:13:01 +01:00
parent 3d6535098f
commit 90d929e7bf

View File

@@ -89,7 +89,7 @@
{{if .MatrixError}} {{if .MatrixError}}
<p class="muted">Chat konnte nicht geladen werden: {{.MatrixError}}</p> <p class="muted">Chat konnte nicht geladen werden: {{.MatrixError}}</p>
{{else if .MatrixMessages}} {{else if .MatrixMessages}}
<div class="matrix-scroll"> <div class="matrix-scroll" id="matrix-scroll">
<ul class="matrix-list"> <ul class="matrix-list">
{{range .MatrixMessages}} {{range .MatrixMessages}}
<li> <li>
@@ -158,5 +158,12 @@
{{if .Error}}<div class="toast error">{{.Error}}</div>{{end}} {{if .Error}}<div class="toast error">{{.Error}}</div>{{end}}
{{if .Info}}<div class="toast info">{{.Info}}</div>{{end}} {{if .Info}}<div class="toast info">{{.Info}}</div>{{end}}
<script>
(function () {
var box = document.getElementById("matrix-scroll");
if (!box) return;
box.scrollTop = box.scrollHeight;
})();
</script>
</body> </body>
</html> </html>