mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +01:00
dont send typing notif on each keyup
This commit is contained in:
@@ -49,11 +49,13 @@ define('forum/chats', ['string', 'sounds'], function(S, sounds) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
inputEl.on('keyup', function() {
|
inputEl.on('keyup', function() {
|
||||||
if ($(this).val()) {
|
var val = !!$(this).val();
|
||||||
Chats.notifyTyping(Chats.getRecipientUid(), true);
|
if ((val && $(this).attr('data-typing') === 'true') || (!val && $(this).attr('data-typing') === 'false')) {
|
||||||
} else {
|
return;
|
||||||
Chats.notifyTyping(Chats.getRecipientUid(), false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Chats.notifyTyping(Chats.getRecipientUid(), val);
|
||||||
|
$(this).attr('data-typing', val);
|
||||||
});
|
});
|
||||||
|
|
||||||
sendEl.on('click', function(e) {
|
sendEl.on('click', function(e) {
|
||||||
|
|||||||
@@ -289,11 +289,13 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats'], function(taskbar,
|
|||||||
});
|
});
|
||||||
|
|
||||||
input.off('keyup').on('keyup', function() {
|
input.off('keyup').on('keyup', function() {
|
||||||
if ($(this).val()) {
|
var val = !!$(this).val();
|
||||||
socket.emit('modules.chats.userStartTyping', {touid:chatModal.attr('touid'), fromUid: app.uid});
|
if ((val && $(this).attr('data-typing') === 'true') || (!val && $(this).attr('data-typing') === 'false')) {
|
||||||
} else {
|
return;
|
||||||
Chats.notifyTyping(chatModal.attr('touid'), false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Chats.notifyTyping(chatModal.attr('touid'), val);
|
||||||
|
$(this).attr('data-typing', val);
|
||||||
});
|
});
|
||||||
|
|
||||||
chatModal.find('#chat-message-send-btn').off('click').on('click', function(e){
|
chatModal.find('#chat-message-send-btn').off('click').on('click', function(e){
|
||||||
|
|||||||
Reference in New Issue
Block a user