FIX: image rendered temporarily in wrong position while loading

Previously non lightboxed images would render in the wrong spot while loading.

We assumed the image we were rendering while loading was at 0,0 position.
This is not the case on non-lightboxed images cause they have no surrounding
DIV.
This commit is contained in:
Sam 2019-01-04 11:49:37 +11:00
parent d7a82f146a
commit d0f38dbb07
1 changed files with 2 additions and 2 deletions

View File

@ -47,8 +47,8 @@ function show(image) {
copyImg.srcset = imageData.srcset || copyImg.srcset;
copyImg.style.position = "absolute";
copyImg.style.top = 0;
copyImg.style.left = 0;
copyImg.style.top = `${image.offsetTop}px`;
copyImg.style.left = `${image.offsetLeft}px`;
copyImg.style.width = imageData.width;
copyImg.style.height = imageData.height;