Commit 4c63bc20 by Lee Munkyeong

コード整理及びメッセージロード修正。

parent cdf37962
var lastscrollvalue; var lastscrollvalue;
window.onscroll = function() { window.onscroll = function() {
var a = $('#messages'); var scrollPosition = window.scrollY || document.documentElement.scrollTop;
if (lastscrollvalue == undefined) { if (scrollPosition == 0) {
lastscrollvalue = a.scrollTop; console.log('Scroll on TOP!!');
// sets lastscrollvalue //TODO add getMessages(newLine);
} else if (a.scrollTop > lastscrollvalue) { if (CHAT_UTIL.isIOS()) {
// downscroll rules will be here } else if (CHAT_UTIL.isAndroid()) {
lastscrollvalue = a.scrollTop; //android.getMessages()
}
}
}
} else if (a.scrollTop < lastscrollvalue) { /*
// upscroll rules will be here $('#messages').scroll(function() {
lastscrollvalue = a.scrollTop; console.log('messagescroll');
} if ($(this).scrollTop() === 0) {
} if (!$('#chatLoader').is(':visible')) {
\ No newline at end of file // 現在、メッセージの個数以前をメッセージを読み込む
// ローディングアイコンを追加する
let loader = $('<div id="chatLoader" class="text-center"><div class="spinner-grow spinner-grow-sm" role="status" /></div>')
$('#messages').prepend(loader)
loader.remove();
// socket.emit('getMessages', $(this).children().length, function() {
// // ローディングアイコンを削除する
// loader.remove();
// });
}
}
});*/
...@@ -1193,7 +1193,7 @@ CHAT_UI.loadMessages = function(roomId, roomName) { ...@@ -1193,7 +1193,7 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
$('#messages').scroll(); $('#messages').scroll();
} }
} }
CHAT_UI.waitForLoadingImage(jQueryMessages, CHAT_UI.scrollToBottom);
// ユーザ削除ボタン表示しない // ユーザ削除ボタン表示しない
$("#userSelectionDeleteBtn").hide(); $("#userSelectionDeleteBtn").hide();
CHAT_UI.scrollToBottom(); CHAT_UI.scrollToBottom();
......
...@@ -163,8 +163,6 @@ function setSocketAction () { ...@@ -163,8 +163,6 @@ function setSocketAction () {
// New Message // New Message
// #36170 // #36170
socket.on('newMessage', function(message, roomId, roomName) { socket.on('newMessage', function(message, roomId, roomName) {
console.log('newMessage');
let messageTime = CHAT_UTIL.formatDate(message.createdAt); let messageTime = CHAT_UTIL.formatDate(message.createdAt);
var userMessageTemplate; var userMessageTemplate;
$.get({ url: "./template/template_user_message.html", async: false } $.get({ url: "./template/template_user_message.html", async: false }
......
...@@ -335,7 +335,7 @@ $(function() { ...@@ -335,7 +335,7 @@ $(function() {
$(this).toggleClass("filter"); $(this).toggleClass("filter");
}); });
$('#chat .search_form input[type="search"]').keyup(function(){ $('#chat .search_form input[type="search"]').click(function(){
let roomListTitle = getLocalizedString("room_search_placeholder"); let roomListTitle = getLocalizedString("room_search_placeholder");
$('#chatTitle').text(roomListTitle); $('#chatTitle').text(roomListTitle);
}); });
......
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