use different ids
This commit is contained in:
parent
dfd66232fc
commit
6b3634ec4c
2 changed files with 3 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
2
watch.go
2
watch.go
|
|
@ -430,7 +430,7 @@ func (w *watcher) handleRoot(hw http.ResponseWriter, r *http.Request) {
|
|||
</head>
|
||||
<body data-d2-dev-mode=%t>
|
||||
<div id="d2-err" style="display: none"></div>
|
||||
<div id="d2-svg"></div>
|
||||
<div id="d2-svg-container"></div>
|
||||
</body>
|
||||
</html>`, w.outputPath, w.devMode)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue