xP: also scroll to bottom on window resize
This commit is contained in:
parent
632ac992ab
commit
36529a46fd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user