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
e4fe6fb8
Commit
e4fe6fb8
authored
Apr 22, 2021
by
Kang Donghun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#42526 チャット一覧からチャット後のルームを選択すると、最新メッセージが表示されない
parent
057364bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
21 deletions
+24
-21
public_new/chat_room.html
+2
-1
public_new/js/chat-ui.js
+21
-19
public_new/js/chat.js
+1
-1
No files found.
public_new/chat_room.html
View file @
e4fe6fb8
...
...
@@ -150,6 +150,7 @@
<script
src=
"./js/libs/jquery.mark.min.js"
></script>
<script
src=
"./js/common.js"
></script>
<script
src=
"./js/language.js"
></script>
<script
src=
"./js/loading.js"
></script>
<script
src=
"./js/language_ko.js"
charset=
"UTF-8"
></script>
<script
src=
"./js/language_ja.js"
charset=
"UTF-8"
></script>
<script
src=
"./js/language_en.js"
charset=
"UTF-8"
></script>
...
...
@@ -169,6 +170,7 @@
String
.
prototype
.
replaceAll
=
function
(
org
,
dest
)
{
return
this
.
split
(
org
).
join
(
dest
);
}
$
(
"#loadingArea"
).
load
(
"./loading.html"
);
let
CHAT_SERVER_URL
=
''
;
let
CMS_SERVER_URL
=
''
;
...
...
@@ -196,7 +198,6 @@
IS_MOBILE
=
isMobile
;
IS_ONLINE
=
isOnline
;
CHAT_UI
.
loadMessages
(
CHAT
.
globalLoginParameter
.
roomId
,
CHAT
.
globalLoginParameter
.
roomName
);
};
</script>
</body>
...
...
public_new/js/chat-ui.js
View file @
e4fe6fb8
...
...
@@ -555,7 +555,7 @@ CHAT_UI.scrollToBottom = function() {
//messages.scrollTop(scrollHeight);
$
(
'html, body'
).
animate
({
scrollTop
:
scrollHeight
},
5
00
);
},
1
00
);
};
CHAT_UI
.
scrollToLastMarkedUnseen
=
function
(
value
)
{
...
...
@@ -879,6 +879,24 @@ CHAT_UI.htmlElementTextInitialize = function(languageCode) {
// 画像の読み込みが全て終わったタイミングでコールバック実行
// FIXME 追加読み込みの場合は差分の画像のみ監視すべきだが、現状新規入室時にしか対応出来ていない。
CHAT_UI
.
waitForLoadingVideo
=
function
(
div
,
callback
)
{
CHAT_UI
.
showLoadingIndicator
();
// var imgs = document.getElementsByTagName("video");
var
video
=
div
.
find
(
"video"
);
var
count
=
video
.
length
;
if
(
count
==
0
)
callback
();
var
loaded
=
0
;
video
.
each
(
function
()
{
this
.
addEventListener
(
'loadeddata'
,
function
(
e
)
{
loaded
++
;
if
(
loaded
===
count
)
{
callback
();
CHAT_UI
.
dismissLoadingIndicator
();
}
});
});
}
CHAT_UI
.
waitForLoadingImage
=
function
(
div
,
callback
)
{
var
imgs
=
div
.
find
(
"img"
);
var
count
=
imgs
.
length
;
...
...
@@ -895,10 +913,8 @@ CHAT_UI.waitForLoadingImage = function(div, callback) {
if
(
this
.
complete
||
this
.
readyState
===
readyState
.
COMPLETED
)
{
$
(
this
).
trigger
(
"load"
);
}
});
}
$
(
'#contactButton'
).
on
(
'click'
,
function
(
event
)
{
CHAT_UI
.
refreshContactScreen
();
});
...
...
@@ -1286,26 +1302,13 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
html
=
message
.
message
.
includes
(
'attachedImages'
)
||
message
.
message
.
includes
(
'attachedVideos'
)
?
CHAT_UTIL
.
htmlDecode
(
html
)
:
html
;
workVal
=
html
+
workVal
;
})
// メッセージの画面描画
jQueryMessages
.
prepend
(
workVal
);
if
(
beforeHeight
!==
0
)
{
// 追加のメッセージ読み込み時は読み込み前のスクロール位置を維持
setTimeout
(
function
()
{
jQueryMessages
.
scrollTop
(
jQueryMessages
.
prop
(
'scrollHeight'
)
-
beforeHeight
);
},
400
);
}
else
{
// 新規に入室の場合は最下部へスクロール
CHAT_UI
.
waitForLoadingImage
(
jQueryMessages
,
CHAT_UI
.
scrollToBottom
);
// タブレット等、画面サイズが大きい場合、スクロール出来なくならないよう追加で10件メッセージを取得
if
(
$
(
window
).
height
()
>
jQueryMessages
.
height
())
{
$
(
'#messages'
).
scroll
();
}
}
CHAT_UI
.
waitForLoadingImage
(
jQueryMessages
,
CHAT_UI
.
scrollToBottom
);
CHAT_UI
.
waitForLoadingVideo
(
jQueryMessages
,
CHAT_UI
.
scrollToBottom
);
// ユーザ削除ボタン表示しない
$
(
"#userSelectionDeleteBtn"
).
hide
();
CHAT_UI
.
scrollToBottom
();
};
...
...
@@ -2128,7 +2131,6 @@ CHAT_UI.showAddUserConfirmView = function() {
var
selectedUserList
=
CHAT_DB
.
loadSelectedUsers
();
console
.
log
(
"check = "
+
selectedUserList
);
selectedUserList
.
forEach
(
function
(
user
){
let
html
=
Mustache
.
render
(
userTemplate
,
{
id
:
user
.
shopMemberId
,
...
...
public_new/js/chat.js
View file @
e4fe6fb8
...
...
@@ -84,7 +84,7 @@ CHAT.createVideoThumbnailAndUpload = function(sourceImage, callback) {
// Load video in Safari / IE11
video
.
muted
=
true
;
video
.
playsInline
=
true
;
video
.
p
lay
();
video
.
p
ause
();
};
fileReader
.
readAsArrayBuffer
(
sourceImage
);
}
...
...
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