Matrix-Chat beim Laden automatisch zur neuesten Nachricht scrollen
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user