use connected callback for loading SVGs instead of constructor

This commit is contained in:
Jonas Leder 2022-03-25 09:38:20 +01:00
parent c4685355b5
commit f155578daa
No known key found for this signature in database
GPG key ID: CC3C488E27DFF5CA

View file

@ -1,6 +1,5 @@
class svgLoad extends HTMLElement {
constructor(){
super();
connectedCallback() {
let svgName = this.getAttribute("data-name");
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = () => {