From 3325c83500fdde953523b344224daf67c356878f Mon Sep 17 00:00:00 2001 From: Rohan Sircar Date: Sat, 30 May 2020 10:51:24 +0530 Subject: [PATCH] [Frontend] Add animation when new message arrives --- chatto/src/main/javascript/ts/src/view/ChatView.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chatto/src/main/javascript/ts/src/view/ChatView.ts b/chatto/src/main/javascript/ts/src/view/ChatView.ts index 1521490..038e45b 100644 --- a/chatto/src/main/javascript/ts/src/view/ChatView.ts +++ b/chatto/src/main/javascript/ts/src/view/ChatView.ts @@ -82,6 +82,14 @@ export class ChatView implements Observer { // if (cd.data.length > 0) { // this._userModel.notify(); // } + $(this._messageContainer) + .stop() + .animate( + { + scrollTop: $(this._messageContainer)[0].scrollHeight, + }, + 1500 + ); } break; case "page":