Frontend: Use thumb model in edit dialog and places

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-04-21 16:46:08 +02:00
parent 3a257684bd
commit 2ba120f563
3 changed files with 7 additions and 3 deletions

View file

@ -378,6 +378,7 @@
import {DateTime} from "luxon"; import {DateTime} from "luxon";
import moment from "moment-timezone" import moment from "moment-timezone"
import countries from "resources/countries.json"; import countries from "resources/countries.json";
import Thumb from "model/thumb";
export default { export default {
name: 'p-tab-photo-edit-details', name: 'p-tab-photo-edit-details',
@ -481,7 +482,7 @@
this.$emit('prev'); this.$emit('prev');
}, },
openPhoto() { openPhoto() {
this.$viewer.show([this.model], 0) this.$viewer.show(Thumb.fromFiles([this.model]), 0)
}, },
refresh(model) { refresh(model) {
if (!model.hasId()) return; if (!model.hasId()) return;

View file

@ -37,6 +37,8 @@
</template> </template>
<script> <script>
import Thumb from "model/thumb";
export default { export default {
name: 'p-tab-photo-edit-files', name: 'p-tab-photo-edit-files',
props: { props: {
@ -60,7 +62,7 @@
computed: {}, computed: {},
methods: { methods: {
openPhoto() { openPhoto() {
this.$viewer.show([this.model], 0) this.$viewer.show(Thumb.fromFiles([this.model]), 0)
}, },
setPrimary(file) { setPrimary(file) {
this.model.setPrimary(file.FileUUID); this.model.setPrimary(file.FileUUID);

View file

@ -27,6 +27,7 @@
import Photo from "model/photo"; import Photo from "model/photo";
import mapboxgl from "mapbox-gl"; import mapboxgl from "mapbox-gl";
import Api from "../common/api"; import Api from "../common/api";
import Thumb from "../model/thumb";
export default { export default {
name: 'p-page-places', name: 'p-page-places',
@ -80,7 +81,7 @@
if (this.photos.length > 0) { if (this.photos.length > 0) {
const index = this.photos.findIndex((p) => p.PhotoUUID === id); const index = this.photos.findIndex((p) => p.PhotoUUID === id);
this.$viewer.show(this.photos, index) this.$viewer.show(Thumb.fromPhotos(this.photos), index)
} else { } else {
this.$notify.warning("No photos found"); this.$notify.warning("No photos found");
} }