From b7dac10ec12eec7a93a1c140f67ccdbf8d74cca1 Mon Sep 17 00:00:00 2001 From: Marc Singer Date: Sat, 31 Mar 2012 16:28:16 -0700 Subject: [PATCH] Issue 166: Color goes away o According to the poster, Hello, here is a patch to fix the problem. The problem was that in some places the author wrote "elem.style.className" while the correct property is "elem.className", thus when the screen was recreated (to fix some bug linked to print preview apparently), the property wasn't saved correctly. Changes applied. --- shellinabox/vt100.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shellinabox/vt100.js b/shellinabox/vt100.js index 1dafd7b..15af940 100644 --- a/shellinabox/vt100.js +++ b/shellinabox/vt100.js @@ -1106,7 +1106,7 @@ VT100.prototype.repairElements = function(console) { for (var span = line.firstChild; span; span = span.nextSibling) { var newSpan = document.createElement(span.tagName); newSpan.style.cssText = span.style.cssText; - newSpan.style.className = span.style.className; + newSpan.className = span.className; this.setTextContent(newSpan, this.getTextContent(span)); newLine.appendChild(newSpan); } @@ -1517,7 +1517,7 @@ VT100.prototype.insertBlankLine = function(y, color, style) { line = document.createElement('div'); var span = document.createElement('span'); span.style.cssText = style; - span.style.className = color; + span.className = color; this.setTextContent(span, this.spaces(this.terminalWidth)); line.appendChild(span); }