shift+enter doesnt submit chat message
This commit is contained in:
parent
d4b6c14e23
commit
35c052350d
|
@ -29,9 +29,10 @@
|
|||
});
|
||||
mtarea = document.getElementById('messageTextarea');
|
||||
mtarea.addEventListener('keypress', function(event) {
|
||||
if (event.key == 'Enter') {
|
||||
text = mtarea.value;
|
||||
if (event.key == 'Enter' && !event.shiftKey) {
|
||||
text = mtarea.value.trim();
|
||||
mtarea.value = '';
|
||||
if (text == '') { return; }
|
||||
socket.emit('message', {message: text, name: 'Anonymous', room: '{{ room_id }}'});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user