aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-03-02 22:56:56 +0300
committerRblSb <msrblsb@gmail.com>2020-03-02 22:56:56 +0300
commit3c5e157371e623630c648a274386c11b7cae3586 (patch)
tree530755eda41c18c6c1f6ac7a1363459ad60a3095
parent5975bccc39f941044649d0ba72f43e5340396c66 (diff)
Try to fix rare autoscroll problem
-rw-r--r--res/client.js2
-rw-r--r--src/client/Main.hx2
2 files changed, 2 insertions, 2 deletions
diff --git a/res/client.js b/res/client.js
index 224cb9e..cc8a891 100644
--- a/res/client.js
+++ b/res/client.js
@@ -1241,7 +1241,7 @@ client_Main.prototype = {
}
}
textDiv.innerHTML = text;
- var isInChatEnd = msgBuf.scrollHeight - msgBuf.scrollTop == msgBuf.clientHeight;
+ var isInChatEnd = msgBuf.scrollTop + msgBuf.clientHeight >= msgBuf.scrollHeight - 1;
userDiv.appendChild(tstamp);
userDiv.appendChild(nameDiv);
userDiv.appendChild(textDiv);
diff --git a/src/client/Main.hx b/src/client/Main.hx
index 5631594..9d9b90d 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -528,7 +528,7 @@ class Main {
}
textDiv.innerHTML = text;
- final isInChatEnd = msgBuf.scrollHeight - msgBuf.scrollTop == msgBuf.clientHeight;
+ final isInChatEnd = msgBuf.scrollTop + msgBuf.clientHeight >= msgBuf.scrollHeight - 1;
userDiv.appendChild(tstamp);
userDiv.appendChild(nameDiv);
userDiv.appendChild(textDiv);
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage