mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-05 12:01:17 +01:00
Use scrollStop in chat (#5326)
This commit is contained in:
committed by
Julian Lam
parent
8df47f333e
commit
8ddf7eb922
@@ -8,8 +8,9 @@ define('chat', [
|
||||
'sounds',
|
||||
'forum/chats',
|
||||
'forum/chats/messages',
|
||||
'translator'
|
||||
], function (components, taskbar, S, sounds, Chats, ChatsMessages, translator) {
|
||||
'translator',
|
||||
'scrollStop'
|
||||
], function (components, taskbar, S, sounds, Chats, ChatsMessages, translator, scrollStop) {
|
||||
|
||||
var module = {};
|
||||
var newMessage = false;
|
||||
@@ -196,6 +197,8 @@ define('chat', [
|
||||
handle: '.modal-header'
|
||||
});
|
||||
});
|
||||
|
||||
scrollStop.apply(chatModal.find('[component="chat/messages"]'));
|
||||
|
||||
chatModal.find('#chat-close-btn').on('click', function () {
|
||||
module.close(chatModal);
|
||||
|
||||
@@ -21,7 +21,7 @@ define('scrollStop', function () {
|
||||
|
||||
if (
|
||||
(e.originalEvent.deltaY < 0 && scrollTop === 0) || // scroll up
|
||||
(e.originalEvent.deltaY > 0 && (elementHeight + scrollTop) > scrollHeight) // scroll down
|
||||
(e.originalEvent.deltaY > 0 && (elementHeight + scrollTop) >= scrollHeight) // scroll down
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user