aboutsummaryrefslogtreecommitdiff
path: root/src/site/components/grid
diff options
context:
space:
mode:
authorPitu <[email protected]>2020-12-24 23:45:16 +0900
committerPitu <[email protected]>2020-12-24 23:45:16 +0900
commitfb2c27086f570fec60f4d52dcc9ca80e53186293 (patch)
tree4c4fd056c293b8e0de632023ef19fdea95c009fa /src/site/components/grid
parentMerge pull request #228 from Zephyrrus/begone_trailing_commas (diff)
downloadhost.fuwn.me-fb2c27086f570fec60f4d52dcc9ca80e53186293.tar.xz
host.fuwn.me-fb2c27086f570fec60f4d52dcc9ca80e53186293.zip
Fix ESLint rules once and for all
Diffstat (limited to 'src/site/components/grid')
-rw-r--r--src/site/components/grid/Grid.vue46
-rw-r--r--src/site/components/grid/waterfall/Waterfall.vue41
2 files changed, 41 insertions, 46 deletions
diff --git a/src/site/components/grid/Grid.vue b/src/site/components/grid/Grid.vue
index ea568f0..0693c77 100644
--- a/src/site/components/grid/Grid.vue
+++ b/src/site/components/grid/Grid.vue
@@ -23,10 +23,10 @@
<template v-if="!images.showList">
<Waterfall
- :gutterWidth="10"
- :gutterHeight="4"
+ :gutter-width="10"
+ :gutter-height="4"
:options="{fitWidth: true}"
- :itemWidth="width"
+ :item-width="width"
:items="gridFiles">
<template v-slot="{item}">
<template v-if="isPublic">
@@ -165,32 +165,32 @@ export default {
},
props: {
files: {
- type: Array,
- default: () => []
+ 'type': Array,
+ 'default': () => []
},
total: {
- type: Number,
- default: 0
+ 'type': Number,
+ 'default': 0
},
fixed: {
- type: Boolean,
- default: false
+ 'type': Boolean,
+ 'default': false
},
isPublic: {
- type: Boolean,
- default: false
+ 'type': Boolean,
+ 'default': false
},
width: {
- type: Number,
- default: 150
+ 'type': Number,
+ 'default': 150
},
enableSearch: {
- type: Boolean,
- default: true
+ 'type': Boolean,
+ 'default': true
},
enableToolbar: {
- type: Boolean,
- default: true
+ 'type': Boolean,
+ 'default': true
}
},
data() {
@@ -212,16 +212,16 @@ export default {
},
computed: {
...mapState({
- user: (state) => state.auth.user,
- albums: (state) => state.albums.tinyDetails,
- images: (state) => state.images
+ user: state => state.auth.user,
+ albums: state => state.albums.tinyDetails,
+ images: state => state.images
}),
blank() {
// eslint-disable-next-line global-require, import/no-unresolved
return require('@/assets/images/blank.png');
},
gridFiles() {
- return (this.files || []).filter((v) => !v.hideFromList);
+ return (this.files || []).filter(v => !v.hideFromList);
}
},
watch: {
@@ -259,8 +259,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 openAlbumModal(file) {
const { id } = file;
diff --git a/src/site/components/grid/waterfall/Waterfall.vue b/src/site/components/grid/waterfall/Waterfall.vue
index af2af3f..5a4c569 100644
--- a/src/site/components/grid/waterfall/Waterfall.vue
+++ b/src/site/components/grid/waterfall/Waterfall.vue
@@ -24,24 +24,24 @@ export default {
},
props: {
options: {
- type: Object,
- default: () => {}
+ 'type': Object,
+ 'default': () => {}
},
items: {
- type: Array,
- default: () => []
+ 'type': Array,
+ 'default': () => []
},
itemWidth: {
- type: Number,
- default: 150
+ 'type': Number,
+ 'default': 150
},
gutterWidth: {
- type: Number,
- default: 10
+ 'type': Number,
+ 'default': 10
},
gutterHeight: {
- type: Number,
- default: 4
+ 'type': Number,
+ 'default': 4
}
},
mounted() {
@@ -84,20 +84,20 @@ export default {
this.masonry.layout();
},
diffDomChildren() {
- const oldChildren = this.domChildren.filter((element) => !!element.parentNode);
+ const oldChildren = this.domChildren.filter(element => Boolean(element.parentNode));
const newChildren = this.getNewDomChildren();
- const removed = oldChildren.filter((oldChild) => !newChildren.includes(oldChild));
- const domDiff = newChildren.filter((newChild) => !oldChildren.includes(newChild));
+ const removed = oldChildren.filter(oldChild => !newChildren.includes(oldChild));
+ const domDiff = newChildren.filter(newChild => !oldChildren.includes(newChild));
const prepended = domDiff.filter((newChild, index) => newChildren[index] === newChild);
- const appended = domDiff.filter((el) => !prepended.includes(el));
+ const appended = domDiff.filter(el => !prepended.includes(el));
let moved = [];
if (removed.length === 0) {
moved = oldChildren.filter((child, index) => index !== newChildren.indexOf(child));
}
this.domChildren = newChildren;
return {
- old: oldChildren,
- new: newChildren,
+ 'old': oldChildren,
+ 'new': newChildren,
removed,
appended,
prepended,
@@ -120,15 +120,10 @@ export default {
getNewDomChildren() {
const node = this.$refs.waterfall;
const children = this.options && this.options.itemSelector
- ? node.querySelectorAll(this.options.itemSelector) : node.children;
+ ? node.querySelectorAll(this.options.itemSelector)
+ : node.children;
return Array.prototype.slice.call(children);
}
}
};
</script>
-
-<style lang="scss" scoped>
-.wfi {
-
-}
-</style>