mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-23 03:59:30 -07:00
properly add canvases to container
This commit is contained in:
@@ -95,8 +95,14 @@ class WeatherDisplay {
|
|||||||
// only create it once
|
// only create it once
|
||||||
if (this.elemId) return;
|
if (this.elemId) return;
|
||||||
this.elemId = elemId;
|
this.elemId = elemId;
|
||||||
|
|
||||||
|
// create a canvas
|
||||||
|
const canvas = document.createElement('template');
|
||||||
|
canvas.innerHTML = `<canvas id='${elemId+'Canvas'}' width='${width}' height='${height}'/ style='display: none;'>`;
|
||||||
|
|
||||||
|
// add to the page
|
||||||
const container = document.getElementById('container');
|
const container = document.getElementById('container');
|
||||||
container.innerHTML += `<canvas id='${elemId+'Canvas'}' width='${width}' height='${height}'/ style='display: none;'>`;
|
container.appendChild(canvas.content.firstChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get necessary data for this display
|
// get necessary data for this display
|
||||||
|
|||||||
Reference in New Issue
Block a user