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