diff --git a/static/components/canvas-display/canvas-display.js b/static/components/canvas-display/canvas-display.js index 82a864d..6bc47dc 100644 --- a/static/components/canvas-display/canvas-display.js +++ b/static/components/canvas-display/canvas-display.js @@ -13,12 +13,47 @@ class CanvasDisplay extends HTMLElement { // Attach shadow root this.attachShadow({ mode: "open" }); - // Grab the template defined in canvas-display.html - const tmpl = document.getElementById("canvas-display-template"); - if (!tmpl) { - console.error("CanvasDisplay: template not found"); - return; - } + // Create a template element with the canvas-display markup directly in JS + const tmpl = document.createElement("template"); + tmpl.innerHTML = ` + + +
+ + +
+ +`; this.shadowRoot.appendChild(tmpl.content.cloneNode(true)); // Elements inside the shadow DOM diff --git a/static/components/side-menu/side-menu.js b/static/components/side-menu/side-menu.js index c0d572a..2a77f2e 100644 --- a/static/components/side-menu/side-menu.js +++ b/static/components/side-menu/side-menu.js @@ -6,11 +6,51 @@ class SideMenu extends HTMLElement { // Attach a shadow root and clone the template defined in side-menu.html this.attachShadow({ mode: "open" }); - const tmpl = document.getElementById("side-menu-template"); - if (!tmpl) { - console.error("SideMenu: template not found"); - return; + // Create a template element with the side‑menu markup directly in JS + const tmpl = document.createElement("template"); + tmpl.innerHTML = ` + + +
+ +`; this.shadowRoot.appendChild(tmpl.content.cloneNode(true)); // Reference the toggle button and the menu container