aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.js
diff options
context:
space:
mode:
authorsD <stoned@derpymail.org>2020-04-07 18:04:26 +0200
committersD <stoned@derpymail.org>2020-04-07 18:04:26 +0200
commit4518ae6f35e907b4a08b741f2b2b8cdb94283f31 (patch)
tree7e4cbd685814bd3c6185d4afe6c6ff960c15ff40 /webAO/client.js
parent0a66c6ed8c88a6e9a58453cdc6293a3a14891020 (diff)
clear the timeout first, then get the html elements
Diffstat (limited to 'webAO/client.js')
-rw-r--r--webAO/client.js30
1 files changed, 16 insertions, 14 deletions
diff --git a/webAO/client.js b/webAO/client.js
index 632bf69..1a4d8db 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -1516,27 +1516,19 @@ async changeBackground(position) {
this.textTimer = 0;
this._animating = true;
- const charSprite = document.getElementById("client_char");
- const pairSprite = document.getElementById("client_pair_char");
- const nameBox = document.getElementById("client_name");
- const chatBox = document.getElementById("client_chat");
- const chatContainerBox = document.getElementById("client_chatcontainer");
- const waitingBox = document.getElementById("client_chatwaiting");
- const eviBox = document.getElementById("client_evi");
- const shoutSprite = document.getElementById("client_shout");
- const chatBoxInner = document.getElementById("client_inner_chat");
- const fg = document.getElementById("client_fg");
- const gamewindow = document.getElementById("client_gamewindow");
-
- let gifLength = 0;
-
// stop updater
clearTimeout(this.updater);
+ const fg = document.getElementById("client_fg");
+ const gamewindow = document.getElementById("client_gamewindow");
+ const waitingBox = document.getElementById("client_chatwaiting");
+
// Reset CSS animation
fg.style.animation = "";
gamewindow.style.animation = "";
waitingBox.innerText = "";
+
+ const eviBox = document.getElementById("client_evi");
if (this.lastEvi !== this.chatmsg.evidence) {
eviBox.style.opacity = "0";
@@ -1544,6 +1536,14 @@ async changeBackground(position) {
}
this.lastEvi = this.chatmsg.evidence;
+ const charSprite = document.getElementById("client_char");
+ const pairSprite = document.getElementById("client_pair_char");
+
+ const nameBox = document.getElementById("client_name");
+ const chatBox = document.getElementById("client_chat");
+ const chatContainerBox = document.getElementById("client_chatcontainer");
+ const chatBoxInner = document.getElementById("client_inner_chat");
+
//Clear out the last message
chatBoxInner.innerText = this.textnow;
nameBox.innerText = this.chatmsg.nameplate;
@@ -1580,6 +1580,7 @@ async changeBackground(position) {
}
// gets which shout shall played
+ const shoutSprite = document.getElementById("client_shout");
const shout = this.shouts[this.chatmsg.objection];
if (shout) {
// Hide message box
@@ -1609,6 +1610,7 @@ async changeBackground(position) {
}
this.chatmsg.startpreanim = true;
+ let gifLength = 0;
switch (this.chatmsg.type) {
// case 0:
// normal emote, no preanim