aboutsummaryrefslogtreecommitdiff
path: root/src/site/components/image-modal
diff options
context:
space:
mode:
Diffstat (limited to 'src/site/components/image-modal')
-rw-r--r--src/site/components/image-modal/AlbumInfo.vue20
-rw-r--r--src/site/components/image-modal/ImageInfo.vue21
-rw-r--r--src/site/components/image-modal/TagInfo.vue16
3 files changed, 28 insertions, 29 deletions
diff --git a/src/site/components/image-modal/AlbumInfo.vue b/src/site/components/image-modal/AlbumInfo.vue
index 17c375a..8aeb02e 100644
--- a/src/site/components/image-modal/AlbumInfo.vue
+++ b/src/site/components/image-modal/AlbumInfo.vue
@@ -24,22 +24,20 @@
</template>
<script>
-import { mapState } from 'vuex';
-
export default {
name: 'Albuminfo',
props: {
imageId: {
- type: Number,
- default: 0
+ 'type': Number,
+ 'default': 0
},
imageAlbums: {
- type: Array,
- default: () => []
+ 'type': Array,
+ 'default': () => []
},
albums: {
- type: Array,
- default: () => []
+ 'type': Array,
+ 'default': () => []
}
},
data() {
@@ -52,7 +50,7 @@ export default {
this.orderedAlbums = this.getOrderedAlbums();
// we're sorting here instead of computed because we want sort on creation
// then the array's values should be frozen
- this.selectedOptions = this.imageAlbums.map((e) => e.id);
+ this.selectedOptions = this.imageAlbums.map(e => e.id);
},
methods: {
getOrderedAlbums() {
@@ -70,8 +68,8 @@ export default {
},
isAlbumSelected(id) {
if (!this.showingModalForFile) return false;
- const found = this.showingModalForFile.albums.find((el) => el.id === id);
- return !!(found && found.id);
+ const found = this.showingModalForFile.albums.find(el => el.id === id);
+ return Boolean(found && found.id);
},
async handleClick(id) {
// here the album should be already removed from the selected list
diff --git a/src/site/components/image-modal/ImageInfo.vue b/src/site/components/image-modal/ImageInfo.vue
index 73b6339..07c87b5 100644
--- a/src/site/components/image-modal/ImageInfo.vue
+++ b/src/site/components/image-modal/ImageInfo.vue
@@ -97,12 +97,12 @@
<div class="divider is-lolisafe has-text-light">
Tags
</div>
- <Taginfo :imageId="file.id" :imageTags="tags" />
+ <Taginfo :image-id="file.id" :image-tags="tags" />
<div class="divider is-lolisafe has-text-light">
Albums
</div>
- <Albuminfo :imageId="file.id" :imageAlbums="albums" :albums="tinyDetails" />
+ <Albuminfo :image-id="file.id" :image-albums="albums" :albums="tinyDetails" />
</div>
</div>
</div>
@@ -122,21 +122,21 @@ export default {
},
props: {
file: {
- type: Object,
- default: () => ({})
+ 'type': Object,
+ 'default': () => ({})
},
albums: {
- type: Array,
- default: () => ([])
+ 'type': Array,
+ 'default': () => ([])
},
tags: {
- type: Array,
- default: () => ([])
+ 'type': Array,
+ 'default': () => ([])
}
},
computed: mapState({
- images: (state) => state.images,
- tinyDetails: (state) => state.albums.tinyDetails
+ images: state => state.images,
+ tinyDetails: state => state.albums.tinyDetails
}),
methods: {
formatBytes(bytes, decimals = 2) {
@@ -148,6 +148,7 @@ export default {
const i = Math.floor(Math.log(bytes) / Math.log(k));
+ // eslint-disable-next-line no-mixed-operators
return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
},
isVideo(type) {
diff --git a/src/site/components/image-modal/TagInfo.vue b/src/site/components/image-modal/TagInfo.vue
index 59d01f5..756a32d 100644
--- a/src/site/components/image-modal/TagInfo.vue
+++ b/src/site/components/image-modal/TagInfo.vue
@@ -22,12 +22,12 @@ export default {
name: 'Taginfo',
props: {
imageId: {
- type: Number,
- default: 0
+ 'type': Number,
+ 'default': 0
},
imageTags: {
- type: Array,
- default: () => []
+ 'type': Array,
+ 'default': () => []
}
},
data() {
@@ -37,14 +37,14 @@ export default {
},
computed: {
...mapState({
- tags: (state) => state.tags.tagsList
+ tags: state => state.tags.tagsList
}),
- selectedTags() { return this.imageTags.map((e) => e.name); },
- lowercaseTags() { return this.imageTags.map((e) => e.name.toLowerCase()); }
+ selectedTags() { return this.imageTags.map(e => e.name); },
+ lowercaseTags() { return this.imageTags.map(e => e.name.toLowerCase()); }
},
methods: {
getFilteredTags(str) {
- this.filteredTags = this.tags.map((e) => e.name).filter((e) => {
+ this.filteredTags = this.tags.map(e => e.name).filter(e => {
// check if the search string matches any of the tags
const sanitezedTag = e.toString().toLowerCase();
const matches = sanitezedTag.indexOf(str.toLowerCase()) >= 0;