From 866d3c6aca9f96baddf0547f4b8f088db86d98a7 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Wed, 14 Dec 2022 16:10:28 -0800 Subject: [PATCH] fix instance article element selection --- scripts/elements.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/elements.js b/scripts/elements.js index 8bab57a..1db9e64 100644 --- a/scripts/elements.js +++ b/scripts/elements.js @@ -25,19 +25,19 @@ class Instance extends HTMLElement { set data (data) { let instanceArticle = this.shadowElement.querySelector("article"); - let typeImg = document.querySelector("#instance-type"); + let typeImg = this.shadowElement.querySelector("#instance-type"); typeImg.src = `images/instances/${data.type}/${data.status}.svg`; - let vmidParagraph = document.querySelector("#instance-id"); + let vmidParagraph = this.shadowElement.querySelector("#instance-id"); vmidParagraph.innerText = data.vmid; - let nameParagraph = document.querySelector("#instance-name"); + let nameParagraph = this.shadowElement.querySelector("#instance-name"); nameParagraph.innerText = data.name; - let nodeImg = document.querySelector("#node-status"); + let nodeImg = this.shadowElement.querySelector("#node-status"); nodeImg.src = `images/nodes/${data.node.status}.svg`; - let nodeParagraph = document.querySelector("#node-name"); + let nodeParagraph = this.shadowElement.querySelector("#node-name"); nodeParagraph.innerText = data.node.name; } }