From 4debcae7f4ddedd0bf5c6872b7d5405f82e0995e Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Fri, 18 Dec 2020 16:59:34 +0100 Subject: [PATCH] Frontend: Code clean-up --- frontend/.eslintrc.js | 4 +- frontend/src/component/photo/cards.vue | 73 +++++++++---------- frontend/src/component/photo/clipboard.vue | 76 ++++++++++---------- frontend/src/component/photo/list.vue | 56 ++++++++------- frontend/src/component/photo/mosaic.vue | 26 +++---- frontend/src/component/photo/toolbar.vue | 82 +++++++++++----------- frontend/src/component/photo/viewer.vue | 28 ++++---- frontend/src/share/photo/list.vue | 4 +- 8 files changed, 176 insertions(+), 173 deletions(-) diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index e85082e8d..1e71fd74a 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -19,8 +19,8 @@ module.exports = { // Settings for how to process Vue SFC Blocks SFCBlocks: { template: false, - script: true, - style: true, + script: false, + style: false, }, // Use prettierrc for prettier options or not (default: `true`) diff --git a/frontend/src/component/photo/cards.vue b/frontend/src/component/photo/cards.vue index dff0e36d6..5c2de431b 100644 --- a/frontend/src/component/photo/cards.vue +++ b/frontend/src/component/photo/cards.vue @@ -3,10 +3,10 @@
-

+

Couldn't find recently edited

-

+

Couldn't find anything

@@ -26,16 +26,16 @@ :data-uid="photo.UID" class="p-photo" xs12 sm6 md4 lg3 xl2 d-flex - v-bind:class="{ 'is-selected': $clipboard.has(photo), portrait: photo.Portrait }" + :class="{ 'is-selected': clipboard.has(photo), portrait: photo.Portrait }" > - + - @@ -72,11 +72,11 @@ lock - - check_circle radio_button_off @@ -96,12 +96,12 @@ @@ -117,7 +117,7 @@ + title="RAW" @click.stop.prevent="openPhoto(index, true)"> photo_camera @@ -125,47 +125,47 @@

-

-
+
- diff --git a/frontend/src/component/photo/mosaic.vue b/frontend/src/component/photo/mosaic.vue index 4b438ad61..318a6b740 100644 --- a/frontend/src/component/photo/mosaic.vue +++ b/frontend/src/component/photo/mosaic.vue @@ -3,10 +3,10 @@
-

+

Couldn't find recently edited

-

+

Couldn't find anything

@@ -24,15 +24,15 @@ v-for="(photo, index) in photos" :key="index" :data-uid="photo.UID" - v-bind:class="{ selected: $clipboard.has(photo), portrait: photo.Portrait }" + :class="{ selected: $clipboard.has(photo), portrait: photo.Portrait }" class="p-photo" xs4 sm3 md2 lg1 d-flex > - + :title="photo.Title" + @contextmenu="onContextMenu($event, index)"> - @@ -92,12 +92,12 @@ @@ -113,7 +113,7 @@ + title="RAW" @click.stop.prevent="openPhoto(index, true)"> photo_camera @@ -125,7 +125,7 @@ diff --git a/frontend/src/share/photo/list.vue b/frontend/src/share/photo/list.vue index baf081879..7d70327e0 100644 --- a/frontend/src/share/photo/list.vue +++ b/frontend/src/share/photo/list.vue @@ -133,7 +133,7 @@ export default { photos: function (photos) { this.selected.splice(0); - for (let i = 0; i <= photos.length; i++) { + for (let i = 0; i < photos.length; i++) { if (this.$clipboard.has(photos[i])) { this.selected.push(photos[i]); } @@ -194,7 +194,7 @@ export default { refreshSelection() { this.selected.splice(0); - for (let i = 0; i <= this.photos.length; i++) { + for (let i = 0; i < this.photos.length; i++) { if (this.$clipboard.has(this.photos[i])) { this.selected.push(this.photos[i]); }