From c11a7486080bd9f8322e88ccc07ef808e0201427 Mon Sep 17 00:00:00 2001 From: Paul Wieland Date: Wed, 13 Nov 2024 04:57:31 -0500 Subject: [PATCH] display diagram --- static/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/index.html b/static/index.html index 968eb95..4c94db4 100644 --- a/static/index.html +++ b/static/index.html @@ -295,10 +295,10 @@ var hardware = document.querySelector('input[name="hardware"]:checked').value; var diagram_protocol = protocol.replace("v1","").replace("v2",""); - var img = new Image(); + var img = document.querySelector("#wiring_diagram"); img.onerror = function() { console.log(`img not found: ${this.src}`); - document.querySelector("#wiring_diagram").src = "wiring_diagrams/v25iboard_secplus.png"; + this.src = "wiring_diagrams/v25iboard_secplus.png"; } img.src = `wiring_diagrams/${hardware}_${diagram_protocol}.png`;