summaryrefslogtreecommitdiff
path: root/xP/public/xP.js
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-09-28 21:05:02 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-09-28 21:29:08 +0200
commit941ee2f10c0c6d273d4d7bf591a48068141e2c56 (patch)
tree8df8021c0967b722ddee1b656a3176a2e0e9db7e /xP/public/xP.js
parent5b57e9b41b3f339e05f1db285131f16c927d1d98 (diff)
downloadxK-941ee2f10c0c6d273d4d7bf591a48068141e2c56.tar.gz
xK-941ee2f10c0c6d273d4d7bf591a48068141e2c56.tar.xz
xK-941ee2f10c0c6d273d4d7bf591a48068141e2c56.zip
xP: fix automatic scrolling down
Showing channel logs cancelled the AbortController forever. Thus store it within vnodes.
Diffstat (limited to 'xP/public/xP.js')
-rw-r--r--xP/public/xP.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js
index aabf75a..a7b7b11 100644
--- a/xP/public/xP.js
+++ b/xP/public/xP.js
@@ -566,12 +566,6 @@ let Topic = {
}
let Buffer = {
- controller: new AbortController(),
-
- onbeforeremove: vnode => {
- Buffer.controller.abort()
- },
-
onupdate: vnode => {
if (bufferAutoscroll)
vnode.dom.scrollTop = vnode.dom.scrollHeight
@@ -579,8 +573,14 @@ let Buffer = {
oncreate: vnode => {
Buffer.onupdate(vnode)
+
+ vnode.state.controller = new AbortController()
window.addEventListener('resize', event => Buffer.onupdate(vnode),
- {signal: Buffer.controller.signal})
+ {signal: vnode.state.controller.signal})
+ },
+
+ onremove: vnode => {
+ vnode.state.controller.abort()
},
view: vnode => {