Matrix-Chat beim Laden automatisch zur neuesten Nachricht scrollen
This commit is contained in:
@@ -89,7 +89,7 @@
|
||||
{{if .MatrixError}}
|
||||
<p class="muted">Chat konnte nicht geladen werden: {{.MatrixError}}</p>
|
||||
{{else if .MatrixMessages}}
|
||||
<div class="matrix-scroll">
|
||||
<div class="matrix-scroll" id="matrix-scroll">
|
||||
<ul class="matrix-list">
|
||||
{{range .MatrixMessages}}
|
||||
<li>
|
||||
@@ -158,5 +158,12 @@
|
||||
|
||||
{{if .Error}}<div class="toast error">{{.Error}}</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>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user