From 8a56baa8e1b0481867bcbfbe817941c0d76d5ebb Mon Sep 17 00:00:00 2001 From: David Fifield Date: Mon, 22 Jul 2019 16:51:33 -0600 Subject: [PATCH] Identify popup elements by id. --- proxy/static/embed.html | 6 +++--- proxy/static/popup.js | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/proxy/static/embed.html b/proxy/static/embed.html index 176f4c3..b0820fa 100644 --- a/proxy/static/embed.html +++ b/proxy/static/embed.html @@ -10,9 +10,9 @@
- -

Snowflake is off

-

+ +

Snowflake is off

+

diff --git a/proxy/static/popup.js b/proxy/static/popup.js index 5fd2142..7060054 100644 --- a/proxy/static/popup.js +++ b/proxy/static/popup.js @@ -3,18 +3,19 @@ class Popup { constructor() { this.div = document.getElementById('active'); - this.ps = this.div.querySelectorAll('p'); - this.img = this.div.querySelector('img'); + this.statustext = document.getElementById('statustext'); + this.statusdesc = document.getElementById('statusdesc'); + this.img = document.getElementById('statusimg'); } setImgSrc(src) { this.img.src = `assets/status-${src}.png`; } setStatusText(txt) { - this.ps[0].innerText = txt; + this.statustext.innerText = txt; } setStatusDesc(desc, color) { - this.ps[1].innerText = desc; - this.ps[1].style.color = color || 'black'; + this.statusdesc.innerText = desc; + this.statusdesc.style.color = color || 'black'; } hideButton() { document.querySelector('.button').style.display = 'none';