diff --git a/files/assets/js/chat.js b/files/assets/js/chat.js index d4e6e2410..8b0ab17b9 100644 --- a/files/assets/js/chat.js +++ b/files/assets/js/chat.js @@ -96,6 +96,11 @@ socket.on('speak', function(json) { if (scrolled_down) box.scrollTo(0, box.scrollHeight) }) +function scroll_chat() { + setTimeout(function () { + box.scrollTo(0, box.scrollHeight) + }, 0200); +} function send() { text = textbox.value.trim() @@ -107,6 +112,7 @@ function send() { socket.emit('typing', false); } autoExpand(textbox); + scroll_chat(); } function quote(t) { @@ -180,12 +186,6 @@ socket.on('typing', function (users){ } }) -function scroll_chat() { - setTimeout(function () { - box.scrollTo(0, box.scrollHeight) - }, 0200); -} - scroll_chat() box.scrollTo(0, box.scrollHeight) \ No newline at end of file diff --git a/files/templates/chat.html b/files/templates/chat.html index bfd44df57..b73e2f003 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -191,7 +191,7 @@ - +