From ecac43f11322c58d68c0d9f95473b4834fbe5ead Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 3 Mar 2024 19:13:22 -0800 Subject: [PATCH] wasm: fix the blink by injecting a sub-span. --- webfiles/tcell.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/webfiles/tcell.js b/webfiles/tcell.js index 34bf07f..d3ec2ce 100644 --- a/webfiles/tcell.js +++ b/webfiles/tcell.js @@ -91,9 +91,6 @@ function drawCell(x, y, mainc, combc, fg, bg, attrs) { if ((attrs & 1) != 0) { span.classList.add("bold"); } - if ((attrs & (1 << 1)) != 0) { - span.classList.add("blink"); - } if ((attrs & (1 << 3)) != 0) { span.classList.add("underline"); } @@ -119,9 +116,16 @@ function drawCell(x, y, mainc, combc, fg, bg, attrs) { span.classList.add("dashed_underline"); } } - - var textnode = document.createTextNode(combString); - span.appendChild(textnode); + if ((attrs & (1 << 1)) != 0) { + var blink = document.createElement("span"); + 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.data[y].previous = null; // invalidate row- new row