insert output after input
This commit is contained in:
parent
bdb6fcdf05
commit
1197af67ef
|
|
@ -58,12 +58,17 @@ export function addOutput(id: string, output: CommandOutput) {
|
||||||
else
|
else
|
||||||
item.textContent = content
|
item.textContent = content
|
||||||
|
|
||||||
|
const input = document.querySelector(`[data-id="${id}"].input`)
|
||||||
|
if (input instanceof HTMLLIElement)
|
||||||
|
input.parentNode!.insertBefore(item, input.nextSibling)
|
||||||
|
else
|
||||||
scrollback.append(item)
|
scrollback.append(item)
|
||||||
|
|
||||||
autoScroll()
|
autoScroll()
|
||||||
}
|
}
|
||||||
|
|
||||||
export function addErrorMessage(message: string) {
|
export function addErrorMessage(message: string) {
|
||||||
addOutput("", { html: `<span class="red">${message}</span>` })
|
addOutput("", { html: `< span class= "red" > ${message} </span>` })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user