Skip to content

Commit 5181bc5

Browse files
author
Jonas Gossens
committed
Fix deleteImage size
1 parent 9bac623 commit 5181bc5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/react-chayns-gallery/component/Gallery.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,21 @@ export default class Gallery extends Component {
8787
{
8888
urls.map((url, index) => {
8989
if (index <= 3 || deleteMode) {
90-
let scaleHeight = 150;
90+
let shortEdge = window.innerWidth;
9191
if (!deleteMode) {
9292
if (index <= 2 && numberOfImages <= 2) {
93-
scaleHeight = styleHeight;
93+
shortEdge = styleHeight;
9494
} else if (index === 0) {
95-
scaleHeight = parseInt((styleHeight * 2) / 3, 10);
95+
shortEdge = parseInt((styleHeight * 2) / 3, 10);
9696
} else if (index < 4) {
97-
scaleHeight = parseInt(styleHeight / 3, 10);
97+
shortEdge = parseInt(styleHeight / 3, 10);
9898
}
9999
}
100100

101101
return (
102102
<ImageContainer
103103
key={url}
104-
url={Gallery.getScaledImageUrl(url, scaleHeight)}
104+
url={Gallery.getScaledImageUrl(url, shortEdge)}
105105
index={index}
106106
openImage={this.openGallery}
107107
onDelete={onDelete}

0 commit comments

Comments
 (0)