Skip to content

Commit

Permalink
Merge pull request #145 from Neovici/feature/maintain-detached-selection
Browse files Browse the repository at this point in the history
fix: maintain detached images and index if it's the same
  • Loading branch information
megheaiulian authored Nov 4, 2020
2 parents f59032f + 100300d commit a7fc0b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cosmoz-image-viewer.html.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,11 @@ export const template = html`
}
setImages(images, currentImageIndex = 0) {
const prev = this.images,
isSame = prev != null && images.length === prev.length && images.every((img, i) => prev[i] === img);
if (isSame) {
return;
}
this.images = images;
this.currentImageIndex = currentImageIndex;
}
Expand Down

0 comments on commit a7fc0b6

Please sign in to comment.