clean userlist
Este commit está contenido en:
@@ -94,6 +94,10 @@ class App {
|
|||||||
createLi('users', data.user)
|
createLi('users', data.user)
|
||||||
})
|
})
|
||||||
socket.on('users', function (data) {
|
socket.on('users', function (data) {
|
||||||
|
var users = document.getElementById('users')
|
||||||
|
while (users.firstChild) {
|
||||||
|
users.removeChild(users.firstChild)
|
||||||
|
}
|
||||||
data.users.map(user => createLi('users', user))
|
data.users.map(user => createLi('users', user))
|
||||||
})
|
})
|
||||||
socket.on('quit', function (data) {
|
socket.on('quit', function (data) {
|
||||||
@@ -111,7 +115,7 @@ class App {
|
|||||||
socket.emit('emit msg', { user: window.name, chat: chat })
|
socket.emit('emit msg', { user: window.name, chat: chat })
|
||||||
createLi('chats', window.name + ': ' + chat)
|
createLi('chats', window.name + ': ' + chat)
|
||||||
document.getElementById('chatbox').value = ''
|
document.getElementById('chatbox').value = ''
|
||||||
document.getElementById('chats').scrollTo(0,document.getElementById('chats').scrollHeight)
|
document.getElementById('chats').scrollTo(0, document.getElementById('chats').scrollHeight)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
document.getElementById('chatbox').addEventListener('keydown', function (event) {
|
document.getElementById('chatbox').addEventListener('keydown', function (event) {
|
||||||
|
|||||||
Referencia en una nueva incidencia
Block a user