@@ -13,6 +13,7 @@
import WaterfallItem from './WaterfallItem.vue';
const isBrowser = typeof window !== 'undefined';
+// eslint-disable-next-line global-require
const Masonry = isBrowser ? window.Masonry || require('masonry-layout') : null;
const imagesloaded = isBrowser ? require('imagesloaded') : null;
--
cgit v1.2.3
From 90001c2df56d58e69fd199a518ae7f3e4ed327fc Mon Sep 17 00:00:00 2001
From: Zephyrrus
Date: Thu, 24 Dec 2020 10:40:50 +0200
Subject: chore: remove trailing commas
---
src/site/components/grid/waterfall/Waterfall.vue | 26 +++++++++++-----------
.../components/grid/waterfall/WaterfallItem.vue | 2 +-
2 files changed, 14 insertions(+), 14 deletions(-)
(limited to 'src/site/components/grid/waterfall')
diff --git a/src/site/components/grid/waterfall/Waterfall.vue b/src/site/components/grid/waterfall/Waterfall.vue
index 762cbbd..af2af3f 100644
--- a/src/site/components/grid/waterfall/Waterfall.vue
+++ b/src/site/components/grid/waterfall/Waterfall.vue
@@ -20,29 +20,29 @@ const imagesloaded = isBrowser ? require('imagesloaded') : null;
export default {
name: 'Waterfall',
components: {
- WaterfallItem,
+ WaterfallItem
},
props: {
options: {
type: Object,
- default: () => {},
+ default: () => {}
},
items: {
type: Array,
- default: () => [],
+ default: () => []
},
itemWidth: {
type: Number,
- default: 150,
+ default: 150
},
gutterWidth: {
type: Number,
- default: 10,
+ default: 10
},
gutterHeight: {
type: Number,
- default: 4,
- },
+ default: 4
+ }
},
mounted() {
this.initializeMasonry();
@@ -62,7 +62,7 @@ export default {
node,
() => {
this.masonry.layout();
- },
+ }
);
},
performLayout() {
@@ -101,7 +101,7 @@ export default {
removed,
appended,
prepended,
- moved,
+ moved
};
},
initializeMasonry() {
@@ -111,8 +111,8 @@ export default {
{
columnWidth: this.itemWidth,
gutter: this.gutterWidth,
- ...this.options,
- },
+ ...this.options
+ }
);
this.domChildren = this.getNewDomChildren();
}
@@ -122,8 +122,8 @@ export default {
const children = this.options && this.options.itemSelector
? node.querySelectorAll(this.options.itemSelector) : node.children;
return Array.prototype.slice.call(children);
- },
- },
+ }
+ }
};
diff --git a/src/site/components/grid/waterfall/WaterfallItem.vue b/src/site/components/grid/waterfall/WaterfallItem.vue
index c5cade1..2a18606 100644
--- a/src/site/components/grid/waterfall/WaterfallItem.vue
+++ b/src/site/components/grid/waterfall/WaterfallItem.vue
@@ -5,6 +5,6 @@
--
cgit v1.2.3
From fb2c27086f570fec60f4d52dcc9ca80e53186293 Mon Sep 17 00:00:00 2001
From: Pitu
Date: Thu, 24 Dec 2020 23:45:16 +0900
Subject: Fix ESLint rules once and for all
---
src/site/components/grid/waterfall/Waterfall.vue | 41 +++++++++++-------------
1 file changed, 18 insertions(+), 23 deletions(-)
(limited to 'src/site/components/grid/waterfall')
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);
}
}
};
-
-
--
cgit v1.2.3