Commit 79770beb by Kim Peace

Merge branch 'develop' into debug/console_logs

parents a8e6659a 806d1193
...@@ -79,8 +79,10 @@ CHAT_SOCKET.handleMessage = function ( ...@@ -79,8 +79,10 @@ CHAT_SOCKET.handleMessage = function (
if (typeof ChatRoom !== "undefined") { if (typeof ChatRoom !== "undefined") {
// 画像、動画の描画を待ってからスクロール // 画像、動画の描画を待ってからスクロール
setTimeout(function () { setTimeout(function () {
ChatRoom.scrollToBottom(); let jQueryMessages = $("#messages");
}, 300); ChatRoom.waitForLoadingImage(jQueryMessages, ChatRoom.scrollToBottom);
ChatRoom.waitForLoadingVideo(jQueryMessages, ChatRoom.scrollToBottom);
}, 0);
} else { } else {
Common.dismissLoadingIndicator(); Common.dismissLoadingIndicator();
} }
......
...@@ -10,10 +10,10 @@ window.onscroll = function () { ...@@ -10,10 +10,10 @@ window.onscroll = function () {
return; return;
} }
beforeScroll = window.scrollY; beforeScroll = window.scrollY;
ChatRoom.prependMessageWhenScrollIfNeeded(); ChatRoom.appendMessageWhenScrollIfNeeded();
}; };
ChatRoom.prependMessageWhenScrollIfNeeded = function () { ChatRoom.appendMessageWhenScrollIfNeeded = function () {
const beforeHeight = $(".room_container").height(); const beforeHeight = $(".room_container").height();
messageCount = $(".chat_message").length; messageCount = $(".chat_message").length;
if ($(this).scrollTop() === 0 && messageCount >= PagingSize.MESSAGE) { if ($(this).scrollTop() === 0 && messageCount >= PagingSize.MESSAGE) {
...@@ -27,7 +27,7 @@ ChatRoom.prependMessageWhenScrollIfNeeded = function () { ...@@ -27,7 +27,7 @@ ChatRoom.prependMessageWhenScrollIfNeeded = function () {
} }
ChatRoom.loadNewMessage().then((messages) => { ChatRoom.loadNewMessage().then((messages) => {
// prepend message // prepend message
ChatRoom.prependMessage(messages); ChatRoom.appendMessage(messages);
// hide loading indicator // hide loading indicator
if (typeof loader !== "undefined") { if (typeof loader !== "undefined") {
loader.remove(); loader.remove();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment