Skip to content

Commit

Permalink
Fix (gallery): Fix image to not overflow beyond grid border
Browse files Browse the repository at this point in the history
Fixes regression in #30
  • Loading branch information
leojonathanoh committed Sep 26, 2021
1 parent 5d38747 commit a23d163
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webize
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ cat - >> "$indexHtm" <<'EOF'
images[i].parentNode.style.display = "inline-block";
images[i].parentNode.style.width = "100vw";
images[i].parentNode.style.height = "100vh";
images[i].style.width = "100vw";
images[i].style.width = "100%";
images[i].style.height = "auto";
}
setActiveImageIndex(activeImageIndex, true);
Expand All @@ -479,7 +479,7 @@ cat - >> "$indexHtm" <<'EOF'
images[i].parentNode.style.width = "100vw";
images[i].parentNode.style.height = "100vh";
images[i].style.width = "auto";
images[i].style.height = "100vh";
images[i].style.height = "100%";
}
setActiveImageIndex(activeImageIndex, true);
};
Expand All @@ -495,12 +495,12 @@ cat - >> "$indexHtm" <<'EOF'
images[i].parentNode.style.height = "calc(100vw / " + tileFactor + ")";
if (images[i].width >= images[i].height) {
// Landscape
images[i].style.width = "calc(100vw / " + tileFactor + ")";
images[i].style.width = "100%";
images[i].style.height = "auto";
}else {
// Portrait
images[i].style.width = "auto";
images[i].style.height = "calc(100vw / " + tileFactor + ")";
images[i].style.height = "100%";
}
}
setActiveImageIndex(activeImageIndex, true);
Expand Down

0 comments on commit a23d163

Please sign in to comment.