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 = {
|
let Buffer = {
|
||||||
oncreate: vnode => {
|
controller: new AbortController(),
|
||||||
if (vnode.dom !== undefined && bufferAutoscroll)
|
|
||||||
vnode.dom.scrollTop = vnode.dom.scrollHeight
|
onbeforeremove: vnode => {
|
||||||
|
Buffer.controller.abort()
|
||||||
},
|
},
|
||||||
|
|
||||||
onupdate: vnode => {
|
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 => {
|
view: vnode => {
|
||||||
let lines = []
|
let lines = []
|
||||||
let b = buffers.get(bufferCurrent)
|
let b = buffers.get(bufferCurrent)
|
||||||
if (b === undefined)
|
if (b === undefined)
|
||||||
return
|
return m('.buffer')
|
||||||
|
|
||||||
let lastDateMark = undefined
|
let lastDateMark = undefined
|
||||||
let markBefore = b.lines.length
|
let markBefore = b.lines.length
|
||||||
|
Loading…
Reference in New Issue
Block a user