summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/client.js4
-rw-r--r--scripts/gui/chat.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/scripts/client.js b/scripts/client.js
index 1e7bacc..21b3157 100644
--- a/scripts/client.js
+++ b/scripts/client.js
@@ -50,7 +50,7 @@ class Client{
this.socket.addEventListener("handshake", this.handshake.bind(this));
this.socket.addEventListener("menu", this.menu.bind(this));
this.socket.addEventListener("game", this.game.bind(this));
- this.socket.addEventListener("chat", this.chat.bind(this));
+ this.socket.addEventListener("chat", this.msg.bind(this));
this.lobby = new Lobby(document.getElementsByClassName("lobby")[0], this.socket);
@@ -142,7 +142,7 @@ class Client{
}
// Callback when a chat event is recieved from the server
- chat (e)
+ msg (e)
{
let m = e.detail;
this.chat[m.type](m.data);
diff --git a/scripts/gui/chat.js b/scripts/gui/chat.js
index b412694..4bd6933 100644
--- a/scripts/gui/chat.js
+++ b/scripts/gui/chat.js
@@ -10,8 +10,8 @@ class Chat {
let cin = e.getElementsByClassName("chat-input")[0];
this.chatInput = cin.children[0];
- cin.children[0].addEventListener("keydown", this.checkEnter.bind(this));
- cin.children[1].addEventListener("click", this.sendMessage.bind(this));
+ cin.getElementsByTagName("input")[0].addEventListener("keydown", this.checkEnter.bind(this));
+ cin.getElementsByTagName("button")[0].addEventListener("click", this.sendMessage.bind(this));
}
getChannel (name)