|
|
@@ -199,30 +199,16 @@ export default {
|
|
199
|
199
|
// and the post type has changed
|
|
200
|
200
|
type(newType, oldType) {
|
|
201
|
201
|
if(!postTypes.includes(newType)) return console.warn('type not valid...')
|
|
|
202
|
+ this.clearAndInitPostList('type change')
|
|
202
|
203
|
},
|
|
203
|
204
|
sortBy(newSort, oldSort) {
|
|
204
|
|
- console.log('newSort :', newSort)
|
|
|
205
|
+ this.clearAndInitPostList('sort change')
|
|
205
|
206
|
},
|
|
206
|
207
|
// Only fire if the sort type has changed
|
|
207
|
208
|
// and the post type is the same
|
|
208
|
209
|
// and both sorts are valid
|
|
209
|
210
|
$route(to, from) {
|
|
210
|
|
- const validSorts = Object.values(sortTypes)
|
|
211
|
|
-
|
|
212
|
|
- // Ignore event or exhibition because they're sortable
|
|
213
|
|
- // They're often loaded from sidebar
|
|
214
|
|
- const ignoredFromTypeChange = ['event', 'exhibition']
|
|
215
|
|
- if (
|
|
216
|
|
- // Post slug sometimes appears as a sort so we check it against known sorts
|
|
217
|
|
- validSorts.includes(to.sortBy) &&
|
|
218
|
|
- to.sortBy != from.sortBy
|
|
219
|
|
- ) {
|
|
220
|
|
- this.clearAndInitPostList('sort change')
|
|
221
|
|
- } else if (
|
|
222
|
|
- typeFromRoute(to) != typeFromRoute(from)
|
|
223
|
|
- ) {
|
|
224
|
|
- this.clearAndInitPostList('type change')
|
|
225
|
|
- }
|
|
|
211
|
+ console.log('to :', to)
|
|
226
|
212
|
}
|
|
227
|
213
|
},
|
|
228
|
214
|
mounted() {
|