add decoration test to demo

This commit is contained in:
meganrogge
2022-02-08 15:14:36 -06:00
parent 58c2ba5310
commit a9722371e1
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -149,6 +149,7 @@ if (document.location.pathname === '/test') {
document.getElementById('serialize').addEventListener('click', serializeButtonHandler);
document.getElementById('custom-glyph').addEventListener('click', writeCustomGlyphHandler);
document.getElementById('load-test').addEventListener('click', loadTest);
document.getElementById('decoration').addEventListener('click', decoration);
}
function createTerminal(): void {
@@ -525,3 +526,10 @@ function loadTest() {
term._core._onData.fire('\x03');
});
}
function decoration() {
const marker = term.addMarker(1);
const decoration = term.registerDecoration({ marker });
decoration.element.style.backgroundColor = 'red';
decoration.element.style.position = 'absolute';
}
+1
View File
@@ -64,6 +64,7 @@
<button id="dispose" title="This is used to testing memory leaks">Dispose terminal</button>
<button id="custom-glyph" title="Write custom box drawing and block element characters to the terminal">Test custom glyphs</button>
<button id="load-test" title="Write several MB of data to simulate a lot of data coming from the process">Load test</button>
<button id="decoration" title="Add a decoration to the terminal">Decoration</button>
</div>
</div>
</div>