summaryrefslogtreecommitdiffstats
path: root/site/game.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'site/game.mjs')
-rw-r--r--site/game.mjs6
1 files changed, 3 insertions, 3 deletions
diff --git a/site/game.mjs b/site/game.mjs
index f58f2c2..0fb5974 100644
--- a/site/game.mjs
+++ b/site/game.mjs
@@ -45,10 +45,10 @@ export default class extends HTMLElement {
this.#tickRate.onchange({ target: this.#tickRate });
this.addRobo();
+ this.addRobo();
}
addRobo() {
- console.debug('bjc pre inspector', this.#inspectors);
const i = this.#robos.length;
const { x, y } = this.#arena.randStart();
const robo = {
@@ -68,8 +68,8 @@ export default class extends HTMLElement {
// that's attached is to append the template, then fetch that
// out of the dom. neither cloneNode(true|false) nor
// document.importNode(true|false) worked to fire the event
- // listener.
- this.#inspectorsSection.appendChild(this.#inspectorTemplate.content);
+ // listener if attached before adding it to the dom.
+ this.#inspectorsSection.appendChild(this.#inspectorTemplate.content.cloneNode(true));
const inspector = this.#inspectorsSection.children[this.#inspectorsSection.children.length-1];
inspector.addEventListener(Inspector.compileRequest, e => {
console.debug('compiling for worker', e.detail.text, robo.worker);