|
|
@@ -29,7 +29,7 @@
|
|
29
|
29
|
import { mapGetters } from 'vuex'
|
|
30
|
30
|
import sidebar from '@/components/sidebars/sidebar'
|
|
31
|
31
|
|
|
32
|
|
-import { convertTitleCase, typeFromRoute } from '@/utils/helpers'
|
|
|
32
|
+import { convertTitleCase, typeFromRoute, sortTypes } from '@/utils/helpers'
|
|
33
|
33
|
|
|
34
|
34
|
export default {
|
|
35
|
35
|
props: {
|
|
|
@@ -81,8 +81,11 @@ export default {
|
|
81
|
81
|
|
|
82
|
82
|
// Accounts for the sort-by in URL case
|
|
83
|
83
|
let dispatchName = this.sortBy ? `getAll${type.split('/')[0]}` : `getAll${type}`
|
|
84
|
|
- this.$store.dispatch(dispatchName, this.sortBy)
|
|
85
|
84
|
|
|
|
85
|
+ // Seperate sorting from post slugs
|
|
|
86
|
+ if(Object.values(sortTypes).indexOf(this.sortBy) >= 0) {
|
|
|
87
|
+ this.$store.dispatch(dispatchName, this.sortBy)
|
|
|
88
|
+ }
|
|
86
|
89
|
if(this.$store.state.hero.url !== type) {
|
|
87
|
90
|
this.$store.commit('SET_HERO', type)
|
|
88
|
91
|
}
|
|
|
@@ -93,17 +96,17 @@ export default {
|
|
93
|
96
|
|
|
94
|
97
|
this.$store.dispatch(`getAll${type}`, this.sortBy)
|
|
95
|
98
|
this.$store.commit('SET_HERO', type)
|
|
96
|
|
- console.log(this.isGrid)
|
|
97
|
99
|
}
|
|
98
|
100
|
}
|
|
99
|
101
|
</script>
|
|
100
|
102
|
|
|
101
|
103
|
<style lang="postcss">
|
|
102
|
|
-article
|
|
103
|
|
- .is-grid
|
|
104
|
|
- display: flex
|
|
105
|
|
- flex-direction: row
|
|
106
|
|
- section
|
|
107
|
|
- width: 33%
|
|
108
|
|
-
|
|
|
104
|
+.page--list
|
|
|
105
|
+ article
|
|
|
106
|
+ .is-grid
|
|
|
107
|
+ display: flex
|
|
|
108
|
+ flex-direction: row
|
|
|
109
|
+ flex-wrap: wrap
|
|
|
110
|
+ section
|
|
|
111
|
+ width: 33%
|
|
109
|
112
|
</style>
|