f
This commit is contained in:
parent
96c01f60c4
commit
c2c5aa01a4
2 changed files with 3 additions and 5 deletions
|
@ -11,7 +11,6 @@ const site_name = document.getElementById('site_name').value
|
||||||
const slurreplacer = document.getElementById('slurreplacer').value
|
const slurreplacer = document.getElementById('slurreplacer').value
|
||||||
|
|
||||||
let notifs = 0;
|
let notifs = 0;
|
||||||
let scrolled_down = true;
|
|
||||||
let focused = true;
|
let focused = true;
|
||||||
let is_typing = false;
|
let is_typing = false;
|
||||||
let alert=true;
|
let alert=true;
|
||||||
|
@ -55,8 +54,7 @@ socket.on('speak', function(json) {
|
||||||
let users = document.getElementsByClassName('userlink');
|
let users = document.getElementsByClassName('userlink');
|
||||||
let last_user = users[users.length-1].innerHTML;
|
let last_user = users[users.length-1].innerHTML;
|
||||||
|
|
||||||
console.log(last_user)
|
let scrolled_down = (box.scrollHeight - box.scrollTop <= window.innerHeight-109)
|
||||||
console.log(json['username'])
|
|
||||||
|
|
||||||
if (last_user == json['username']) {
|
if (last_user == json['username']) {
|
||||||
document.getElementsByClassName('chat-line')[0].classList.remove('diff')
|
document.getElementsByClassName('chat-line')[0].classList.remove('diff')
|
||||||
|
@ -79,7 +77,7 @@ socket.on('speak', function(json) {
|
||||||
let line = document.getElementsByClassName('chat-line')[0].cloneNode(true)
|
let line = document.getElementsByClassName('chat-line')[0].cloneNode(true)
|
||||||
bs_trigger(line)
|
bs_trigger(line)
|
||||||
box.append(line)
|
box.append(line)
|
||||||
box.scrollTo(0, box.scrollHeight)
|
if (scrolled_down) box.scrollTo(0, box.scrollHeight)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,7 @@
|
||||||
<input id="site_name" type="hidden" value="{{SITE_NAME}}">
|
<input id="site_name" type="hidden" value="{{SITE_NAME}}">
|
||||||
<input id="slurreplacer" type="hidden" value="{{v.slurreplacer}}">
|
<input id="slurreplacer" type="hidden" value="{{v.slurreplacer}}">
|
||||||
|
|
||||||
<script data-cfasync="false" src="/chat.js?v=8"></script>
|
<script data-cfasync="false" src="/chat.js?v=9"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
box.scrollTo(0, box.scrollHeight)
|
box.scrollTo(0, box.scrollHeight)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue