Added max-width and max-height to v-img to properly size full-screen photos

This commit is contained in:
Michael Mayer 2018-09-25 10:43:20 +02:00
parent c25b843196
commit 9658da6a8d

View file

@ -319,6 +319,8 @@
@click="closePhoto()" @click="closePhoto()"
width="100%" width="100%"
height="100%" height="100%"
:max-width="window.width"
:max-height="window.height"
:srcset="viewDialogPhoto.getThumbnailSrcset()" :srcset="viewDialogPhoto.getThumbnailSrcset()"
:sizes="viewDialogPhoto.getThumbnailSizes()" :sizes="viewDialogPhoto.getThumbnailSizes()"
> >
@ -435,12 +437,20 @@
prevPhoto() { prevPhoto() {
if(this.viewDialogPhotoIndex < 1 || !this.results[this.viewDialogPhotoIndex - 1]) return false; if(this.viewDialogPhotoIndex < 1 || !this.results[this.viewDialogPhotoIndex - 1]) return false;
this.viewDialogPhotoIndex--; this.viewDialogPhotoIndex--;
this.viewDialogPhoto = this.results[this.viewDialogPhotoIndex]; this.viewDialogPhoto = null;
this.$nextTick(function () {
this.viewDialogPhoto = this.results[this.viewDialogPhotoIndex];
})
}, },
nextPhoto() { nextPhoto() {
if(this.viewDialogPhotoIndex >= this.results.length || !this.results[this.viewDialogPhotoIndex + 1]) return false; if(this.viewDialogPhotoIndex >= this.results.length || !this.results[this.viewDialogPhotoIndex + 1]) return false;
this.viewDialogPhotoIndex++; this.viewDialogPhotoIndex++;
this.viewDialogPhoto = this.results[this.viewDialogPhotoIndex]; this.viewDialogPhoto = null;
this.$nextTick(function () {
this.viewDialogPhoto = this.results[this.viewDialogPhotoIndex];
})
}, },
clearSelection() { clearSelection() {
for (let i = 0; i < this.selected.length; i++) { for (let i = 0; i < this.selected.length; i++) {