From 6b3634ec4c6fb683b3bf3ea22115c82558df38d5 Mon Sep 17 00:00:00 2001 From: Bernard Xie Date: Tue, 3 Jan 2023 15:28:51 -0800 Subject: [PATCH] use different ids --- static/watch.js | 4 ++-- watch.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/static/watch.js b/static/watch.js index 6f89b7ac4..44fff3821 100644 --- a/static/watch.js +++ b/static/watch.js @@ -5,7 +5,7 @@ window.addEventListener("DOMContentLoaded", () => { function init(reconnectDelay) { const d2ErrDiv = window.document.querySelector("#d2-err"); - const d2SVG = window.document.querySelector("#d2-svg"); + const d2SVG = window.document.querySelector("#d2-svg-container"); const devMode = document.body.dataset.d2DevMode === "true"; const ws = new WebSocket( @@ -34,7 +34,7 @@ function init(reconnectDelay) { // out the width, height and viewbox out of the top level SVG tag and update those manually. d2SVG.innerHTML = msg.svg; - const svgEl = d2SVG.querySelector("svg"); + const svgEl = d2SVG.querySelector("#d2-svg"); let width = parseInt(svgEl.getAttribute("width"), 10); let height = parseInt(svgEl.getAttribute("height"), 10); if (isInit) { diff --git a/watch.go b/watch.go index 5bc99e5e3..9263ccfba 100644 --- a/watch.go +++ b/watch.go @@ -430,7 +430,7 @@ func (w *watcher) handleRoot(hw http.ResponseWriter, r *http.Request) { -
+
`, w.outputPath, w.devMode) }