From e87503f568f8e203c7826194ff75a17b111d97eb Mon Sep 17 00:00:00 2001 From: Francesco Luzzana Date: Mon, 30 May 2022 01:45:29 +0200 Subject: [PATCH] on resize --- assets/js/cables.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/js/cables.js b/assets/js/cables.js index feeabb8..1efadb8 100644 --- a/assets/js/cables.js +++ b/assets/js/cables.js @@ -24,6 +24,10 @@ class Cable { } } +window.addEventListener("resize", (e) => { + svgElement.setAttribute("viewBox", `0 0 ${svgElement.clientWidth} ${svgElement.clientHeight}`); +}); + window.addEventListener("mousedown", function (e) { let socket = e.target;