diff --git a/frontend/src/component/components.js b/frontend/src/component/components.js index d6997cd18..d53330dd8 100644 --- a/frontend/src/component/components.js +++ b/frontend/src/component/components.js @@ -3,7 +3,6 @@ import PNavigation from "./p-navigation.vue"; import PLoadingBar from "./p-loading-bar.vue"; import PPhotoSearch from "./p-photo-search.vue"; import PPhotoCards from "./p-photo-cards.vue"; -import PPhotoCard from "./p-photo-card.vue"; import PPhotoMosaic from "./p-photo-mosaic.vue"; import PPhotoList from "./p-photo-list.vue"; import PPhotoClipboard from "./p-photo-clipboard.vue"; @@ -21,7 +20,6 @@ components.install = (Vue) => { Vue.component("p-loading-bar", PLoadingBar); Vue.component("p-photo-viewer", PPhotoViewer); Vue.component("p-photo-cards", PPhotoCards); - Vue.component("p-photo-card", PPhotoCard); Vue.component("p-photo-mosaic", PPhotoMosaic); Vue.component("p-photo-list", PPhotoList); Vue.component("p-photo-search", PPhotoSearch); diff --git a/frontend/src/component/p-photo-card.vue b/frontend/src/component/p-photo-card.vue deleted file mode 100644 index 6ae37af6b..000000000 --- a/frontend/src/component/p-photo-card.vue +++ /dev/null @@ -1,149 +0,0 @@ - - diff --git a/frontend/src/component/p-photo-cards.vue b/frontend/src/component/p-photo-cards.vue index 2b4a7bbb1..74b3aa3e5 100644 --- a/frontend/src/component/p-photo-cards.vue +++ b/frontend/src/component/p-photo-cards.vue @@ -21,10 +21,82 @@ xs12 sm6 md4 lg3 d-flex v-bind:class="{ 'is-selected': $clipboard.has(photo) }" > - - + + + + + + + + + check_circle + + radio_button_off + + + + favorite + favorite_border + + + + burst_mode + + + + +
+

+ +

+
+ +
+ +
+ +
+
+
+
+
@@ -42,10 +114,53 @@ }, data() { return { - places: this.$config.settings().features.places, + showLocation: this.$config.settings().features.places, + wasLong: false, }; }, methods: { + longClick() { + this.wasLong = true; + }, + onSelect(ev, model, index) { + if (this.wasLong || ev.shiftKey) { + this.selectRange(index); + } else { + this.$clipboard.toggle(model); + } + + this.wasLong = false; + }, + onClick(ev, model, index) { + if (this.wasLong || this.selection.length > 0) { + ev.preventDefault(); + ev.stopPropagation(); + + if (this.wasLong || ev.shiftKey) { + this.selectRange(index); + } else { + this.$clipboard.toggle(model); + } + } else { + this.openPhoto(index, false); + } + + this.wasLong = false; + }, + contextMenu(ev, model, index) { + if (this.$isMobile) { + ev.preventDefault(); + ev.stopPropagation(); + + if (this.wasLong) { + this.selectRange(index); + } else { + this.$clipboard.toggle(model); + } + } + + this.wasLong = false; + }, selectRange(index) { this.$clipboard.addRange(index, this.photos); } diff --git a/frontend/src/model/rest.js b/frontend/src/model/rest.js index 26b0d5b69..d72e0801b 100644 --- a/frontend/src/model/rest.js +++ b/frontend/src/model/rest.js @@ -91,15 +91,15 @@ class Rest extends Model { if (response.headers) { if (response.headers["x-count"]) { - count = response.headers["x-count"]; + count = parseInt(response.headers["x-count"]); } if (response.headers["x-limit"]) { - limit = response.headers["x-limit"]; + limit = parseInt(response.headers["x-limit"]); } if (response.headers["x-offset"]) { - offset = response.headers["x-offset"]; + offset = parseInt(response.headers["x-offset"]); } } diff --git a/frontend/src/pages/album/photos.vue b/frontend/src/pages/album/photos.vue index 2b5dc2422..cd2241b36 100644 --- a/frontend/src/pages/album/photos.vue +++ b/frontend/src/pages/album/photos.vue @@ -29,12 +29,12 @@ :edit-photo="editPhoto" :open-location="openLocation"> + :photos="results" + :selection="selection" + :album="model" + :open-photo="openPhoto" + :edit-photo="editPhoto" + :open-location="openLocation"> @@ -331,11 +331,13 @@ case 'updated': for (let i = 0; i < data.entities.length; i++) { const values = data.entities[i]; - const model = this.results.find((m) => m.ID === values.ID); + const model = this.results.find((m) => m.PhotoUUID === values.PhotoUUID); - for (let key in values) { - if (values.hasOwnProperty(key)) { - model[key] = values[key]; + if (model) { + for (let key in values) { + if (values.hasOwnProperty(key)) { + model[key] = values[key]; + } } } } diff --git a/frontend/src/pages/photos.vue b/frontend/src/pages/photos.vue index f5835f77a..dba729b76 100644 --- a/frontend/src/pages/photos.vue +++ b/frontend/src/pages/photos.vue @@ -25,11 +25,11 @@ :edit-photo="editPhoto" :open-location="openLocation"> + :photos="results" + :selection="selection" + :open-photo="openPhoto" + :edit-photo="editPhoto" + :open-location="openLocation"> @@ -305,11 +305,13 @@ case 'updated': for (let i = 0; i < data.entities.length; i++) { const values = data.entities[i]; - const model = this.results.find((m) => m.ID === values.ID); + const model = this.results.find((m) => m.PhotoUUID === values.PhotoUUID); - for (let key in values) { - if (values.hasOwnProperty(key)) { - model[key] = values[key]; + if (model) { + for (let key in values) { + if (values.hasOwnProperty(key)) { + model[key] = values[key]; + } } } }