From 2c18a4f7520fb6bbe5b11e5f07dcce2740585c15 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Mon, 2 Apr 2012 17:54:24 +0200 Subject: [PATCH] xynt-console enhanced to allow multiple instaces of it --- web/xynt/xynt-console.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/web/xynt/xynt-console.js b/web/xynt/xynt-console.js index 9a4a7bb..fcce3e6 100644 --- a/web/xynt/xynt-console.js +++ b/web/xynt/xynt-console.js @@ -5,12 +5,22 @@ function xynt_console(ena) { if (ena) { this.win = window.open("","xyntconsole","scrollbars=yes,height=500,width=400,left=0,top=800"); - conbody = this.win.document.createElement("body"); - this.div = condiv = this.win.document.createElement("div"); - conbody.id = "console_body"; - this.win.document.body.appendChild(condiv); - this.win.document.title = "xynt console"; + conbody = this.win.document.getElementById("console_body"); + if (!conbody) { + conbody = this.win.document.createElement("body"); + conbody.id = "console_body"; + this.win.document.title = "xynt console"; + } + + condiv = this.win.document.getElementById("console_div"); + if (!condiv) { + condiv = this.win.document.createElement("div"); + condiv.id = "console_div"; + this.win.document.body.appendChild(condiv); + } + this.div = condiv; + } } -- 2.17.1