Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chat_webview
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abookCommunication
chat_webview
Commits
8f53bd3a
Commit
8f53bd3a
authored
Aug 27, 2021
by
Kim Peace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed scroll to bottom timing in message room when the new picture received from socket
parent
7bc455df
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
public_new/js/sockets/chat-websocket-message.js
+4
-2
public_new/js/views/chats/chat-room.js
+3
-3
No files found.
public_new/js/sockets/chat-websocket-message.js
View file @
8f53bd3a
...
@@ -47,8 +47,10 @@ CHAT_SOCKET.handleMessage = function (message, roomName, socketKey, collaboratio
...
@@ -47,8 +47,10 @@ CHAT_SOCKET.handleMessage = function (message, roomName, socketKey, collaboratio
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
();
}
}
...
...
public_new/js/views/chats/chat-room.js
View file @
8f53bd3a
...
@@ -10,10 +10,10 @@ window.onscroll = function () {
...
@@ -10,10 +10,10 @@ window.onscroll = function () {
return
;
return
;
}
}
beforeScroll
=
window
.
scrollY
;
beforeScroll
=
window
.
scrollY
;
ChatRoom
.
pre
pendMessageWhenScrollIfNeeded
();
ChatRoom
.
ap
pendMessageWhenScrollIfNeeded
();
};
};
ChatRoom
.
pre
pendMessageWhenScrollIfNeeded
=
function
()
{
ChatRoom
.
ap
pendMessageWhenScrollIfNeeded
=
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
.
pre
pendMessage
(
messages
);
ChatRoom
.
ap
pendMessage
(
messages
);
// hide loading indicator
// hide loading indicator
if
(
typeof
loader
!==
"undefined"
)
{
if
(
typeof
loader
!==
"undefined"
)
{
loader
.
remove
();
loader
.
remove
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment