diff options
-rw-r--r-- | xP/public/xP.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js index 7f64473..864323a 100644 --- a/xP/public/xP.js +++ b/xP/public/xP.js @@ -438,20 +438,28 @@ let Content = { } let Buffer = { - oncreate: vnode => { - if (vnode.dom !== undefined && bufferAutoscroll) - vnode.dom.scrollTop = vnode.dom.scrollHeight + controller: new AbortController(), + + onbeforeremove: vnode => { + Buffer.controller.abort() }, onupdate: vnode => { - Buffer.oncreate(vnode) + if (bufferAutoscroll) + vnode.dom.scrollTop = vnode.dom.scrollHeight + }, + + oncreate: vnode => { + Buffer.onupdate(vnode) + window.addEventListener('resize', event => Buffer.onupdate(vnode), + {signal: Buffer.controller.signal}) }, view: vnode => { let lines = [] let b = buffers.get(bufferCurrent) if (b === undefined) - return + return m('.buffer') let lastDateMark = undefined let markBefore = b.lines.length |