xP: clean up
This commit is contained in:
parent
f5104c807d
commit
ee1750c23c
|
@ -171,8 +171,9 @@ rpc.addEventListener('BufferActivate', event => {
|
|||
|
||||
rpc.addEventListener('BufferLine', event => {
|
||||
let e = event.detail, b = buffers.get(e.bufferName)
|
||||
if (b !== undefined)
|
||||
b.lines.push({when: e.when, rendition: e.rendition, items: e.items})
|
||||
if (b === undefined)
|
||||
return
|
||||
b.lines.push({when: e.when, rendition: e.rendition, items: e.items})
|
||||
})
|
||||
|
||||
rpc.addEventListener('BufferClear', event => {
|
||||
|
@ -204,11 +205,11 @@ function applyColor(fg, bg, inverse) {
|
|||
if (inverse)
|
||||
[fg, bg] = [bg >= 0 ? bg : 15, fg >= 0 ? fg : 0]
|
||||
|
||||
let style = ''
|
||||
let style = {}
|
||||
if (fg >= 0)
|
||||
style += `color: ${palette[fg]};`
|
||||
style.color = palette[fg]
|
||||
if (bg >= 0)
|
||||
style += `background-color: ${palette[bg]};`
|
||||
style.backgroundColor = palette[bg]
|
||||
if (style)
|
||||
return style
|
||||
}
|
||||
|
@ -399,9 +400,4 @@ let Main = {
|
|||
},
|
||||
}
|
||||
|
||||
// TODO: Buffer names should work as routes.
|
||||
window.addEventListener('load', () => {
|
||||
m.route(document.body, '/', {
|
||||
'/': Main,
|
||||
})
|
||||
})
|
||||
window.addEventListener('load', () => m.mount(document.body, Main))
|
||||
|
|
Loading…
Reference in New Issue