From 9293616f0296816dd7a6b8809228de633f18a6e0 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 21 Jun 2018 10:32:58 +1000 Subject: [PATCH] Add dispose terminal button to demo --- demo/index.html | 1 + demo/main.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/demo/index.html b/demo/index.html index f374d998..fff77d09 100644 --- a/demo/index.html +++ b/demo/index.html @@ -32,6 +32,7 @@

Attention: The demo is a barebones implementation and is designed for the development and evaluation of xterm.js only. Exposing the demo to the public as is would introduce security risks for the host.

+ diff --git a/demo/main.js b/demo/main.js index 1ed6a180..004a48f0 100644 --- a/demo/main.js +++ b/demo/main.js @@ -76,6 +76,12 @@ function createTerminal() { term.fit(); term.focus(); + document.getElementById('dispose').addEventListener('click', () => { + term.dispose(); + term = null; + window.term = null; + }); + // fit is called within a setTimeout, cols and rows need this. setTimeout(function () { initOptions(term);