wasm: fix the blink by injecting a sub-span.

This commit is contained in:
Garrett D'Amore 2024-03-03 19:13:22 -08:00
parent ef0ee53eee
commit ecac43f113
1 changed files with 10 additions and 6 deletions

View File

@ -91,9 +91,6 @@ function drawCell(x, y, mainc, combc, fg, bg, attrs) {
if ((attrs & 1) != 0) { if ((attrs & 1) != 0) {
span.classList.add("bold"); span.classList.add("bold");
} }
if ((attrs & (1 << 1)) != 0) {
span.classList.add("blink");
}
if ((attrs & (1 << 3)) != 0) { if ((attrs & (1 << 3)) != 0) {
span.classList.add("underline"); span.classList.add("underline");
} }
@ -119,9 +116,16 @@ function drawCell(x, y, mainc, combc, fg, bg, attrs) {
span.classList.add("dashed_underline"); span.classList.add("dashed_underline");
} }
} }
if ((attrs & (1 << 1)) != 0) {
var textnode = document.createTextNode(combString); var blink = document.createElement("span");
span.appendChild(textnode); blink.classList.add("blink");
var textnode = document.createTextNode(combString);
blink.appendChild(textnode);
span.appendChild(blink);
} else {
var textnode = document.createTextNode(combString);
span.appendChild(textnode);
}
content.dirty = true; // invalidate terminal- new cell content.dirty = true; // invalidate terminal- new cell
content.data[y].previous = null; // invalidate row- new row content.data[y].previous = null; // invalidate row- new row