properly add canvases to container
This commit is contained in:
parent
e9b0e3bfcf
commit
b9a85031bd
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue