@@ -226,7 +223,7 @@ export default {
return require('@/assets/images/blank.png');
},
gridFiles() {
- return this.files;
+ return (this.files || []).filter((v) => !v.hideFromList);
},
},
created() {
--
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/Grid.vue | 36 +++++++++++-----------
src/site/components/grid/waterfall/Waterfall.vue | 26 ++++++++--------
.../components/grid/waterfall/WaterfallItem.vue | 2 +-
3 files changed, 32 insertions(+), 32 deletions(-)
(limited to 'src/site/components/grid')
diff --git a/src/site/components/grid/Grid.vue b/src/site/components/grid/Grid.vue
index 1fa3167..3a15335 100644
--- a/src/site/components/grid/Grid.vue
+++ b/src/site/components/grid/Grid.vue
@@ -162,37 +162,37 @@ import ImageInfo from '~/components/image-modal/ImageInfo.vue';
export default {
components: {
Waterfall,
- ImageInfo,
+ ImageInfo
},
props: {
files: {
type: Array,
- default: () => [],
+ default: () => []
},
total: {
type: Number,
- default: 0,
+ default: 0
},
fixed: {
type: Boolean,
- default: false,
+ default: false
},
isPublic: {
type: Boolean,
- default: false,
+ default: false
},
width: {
type: Number,
- default: 150,
+ default: 150
},
enableSearch: {
type: Boolean,
- default: true,
+ default: true
},
enableToolbar: {
type: Boolean,
- default: true,
- },
+ default: true
+ }
},
data() {
return {
@@ -208,15 +208,15 @@ export default {
modalData: {
file: null,
tags: null,
- albums: null,
- },
+ albums: null
+ }
};
},
computed: {
...mapState({
user: (state) => state.auth.user,
albums: (state) => state.albums.tinyDetails,
- images: (state) => state.images,
+ images: (state) => state.images
}),
blank() {
// eslint-disable-next-line global-require, import/no-unresolved
@@ -224,7 +224,7 @@ export default {
},
gridFiles() {
return (this.files || []).filter((v) => !v.hideFromList);
- },
+ }
},
created() {
// TODO: Create a middleware for this
@@ -251,7 +251,7 @@ export default {
} catch (e) {
this.$store.dispatch('alert/set', { text: e.message, error: true }, { root: true });
}
- },
+ }
});
},
isAlbumSelected(id) {
@@ -279,12 +279,12 @@ export default {
if (add) {
response = await this.$store.dispatch('images/addToAlbum', {
albumId: id,
- fileId: this.showingModalForFile.id,
+ fileId: this.showingModalForFile.id
});
} else {
response = await this.$store.dispatch('images/removeFromAlbum', {
albumId: id,
- fileId: this.showingModalForFile.id,
+ fileId: this.showingModalForFile.id
});
}
@@ -332,8 +332,8 @@ export default {
},
isHovered(id) {
return this.hoveredItems.includes(id);
- },
- },
+ }
+ }
};
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 587f7d69e80cfa1d94cc4730dc26834c389f574d Mon Sep 17 00:00:00 2001
From: Zephyrrus
Date: Thu, 24 Dec 2020 13:57:09 +0200
Subject: bug: fix showlist resetting itself every time the page is changed
bug: fix store not commiting search results
---
src/site/components/grid/Grid.vue | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
(limited to 'src/site/components/grid')
diff --git a/src/site/components/grid/Grid.vue b/src/site/components/grid/Grid.vue
index 3a15335..ea568f0 100644
--- a/src/site/components/grid/Grid.vue
+++ b/src/site/components/grid/Grid.vue
@@ -21,9 +21,8 @@
-
+
!v.hideFromList);
}
},
+ watch: {
+ showList: 'displayTypeChange'
+ },
created() {
// TODO: Create a middleware for this
this.getAlbums();
this.getTags();
+
+ this.showList = this.images.showList;
},
methods: {
async search() {
@@ -332,6 +335,9 @@ export default {
},
isHovered(id) {
return this.hoveredItems.includes(id);
+ },
+ displayTypeChange(showList) {
+ this.$store.commit('images/setShowList', showList);
}
}
};
--
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/Grid.vue | 46 ++++++++++++------------
src/site/components/grid/waterfall/Waterfall.vue | 41 ++++++++++-----------
2 files changed, 41 insertions(+), 46 deletions(-)
(limited to 'src/site/components/grid')
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 @@
@@ -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);
}
}
};
-
-
--
cgit v1.2.3
From 09d8d02e6c11bb4aea9cd129bf195868bab0738f Mon Sep 17 00:00:00 2001
From: Pitu
Date: Fri, 25 Dec 2020 02:08:54 +0900
Subject: Cleanup
---
src/site/components/grid/Grid.vue | 4 ----
1 file changed, 4 deletions(-)
(limited to 'src/site/components/grid')
diff --git a/src/site/components/grid/Grid.vue b/src/site/components/grid/Grid.vue
index 0693c77..0c0ac96 100644
--- a/src/site/components/grid/Grid.vue
+++ b/src/site/components/grid/Grid.vue
@@ -388,10 +388,6 @@ div.preview {
div.actions {
opacity: 0;
- -webkit-transition: opacity 0.1s linear;
- -moz-transition: opacity 0.1s linear;
- -ms-transition: opacity 0.1s linear;
- -o-transition: opacity 0.1s linear;
transition: opacity 0.1s linear;
position: absolute;
top: 0px;
--
cgit v1.2.3
From 7190e035b441aef96c8249bb02d12f7cd55a17d9 Mon Sep 17 00:00:00 2001
From: Pitu
Date: Fri, 25 Dec 2020 20:17:47 +0900
Subject: chore: style changes
---
src/site/components/grid/Grid.vue | 1 -
1 file changed, 1 deletion(-)
(limited to 'src/site/components/grid')
diff --git a/src/site/components/grid/Grid.vue b/src/site/components/grid/Grid.vue
index 0c0ac96..9e1ce6f 100644
--- a/src/site/components/grid/Grid.vue
+++ b/src/site/components/grid/Grid.vue
@@ -217,7 +217,6 @@ export default {
images: state => state.images
}),
blank() {
- // eslint-disable-next-line global-require, import/no-unresolved
return require('@/assets/images/blank.png');
},
gridFiles() {
--
cgit v1.2.3