From 4ef5e0daf285f41850c9ac53b0322d85fbf5eaec Mon Sep 17 00:00:00 2001 From: r Date: Thu, 27 Jan 2022 11:52:47 +0000 Subject: Fix null imgPrev in setPos --- static/fluoride.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'static') diff --git a/static/fluoride.js b/static/fluoride.js index 917ffff..6f14f86 100644 --- a/static/fluoride.js +++ b/static/fluoride.js @@ -246,11 +246,11 @@ function handleImgPreview(a) { img.src = e.target.getAttribute("href"); img.style["max-width"] = mw + "px"; img.style["max-height"] = mh + "px"; + imgPrev = img; img.onload = function(e2) { setPos(imgPrev, imgX, imgY, mw, mh); } document.body.appendChild(img); - imgPrev = img; } a.onmouseleave = function(e) { var img = document.getElementById("img-preview"); -- cgit v1.2.3