Explorar el Código

:recycle: adding rule to reload post from single to single | fixing clay to top of material list

tags/0.9.0
J hace 4 años
padre
commit
970ee60c38
Se han modificado 2 ficheros con 13 adiciones y 7 borrados
  1. 6
    1
      vue-theme/src/pages/single.vue
  2. 7
    6
      vue-theme/src/store/modules/artist.js

+ 6
- 1
vue-theme/src/pages/single.vue Ver fichero

@@ -221,12 +221,17 @@ export default {
221 221
         },
222 222
     },
223 223
     watch: {
224
-        // ONLY load post data when navigating TO a single page
225 224
         slug(newSlug, oldSlug) {
225
+            // ONLY load post data when navigating TO a single page
226 226
             if(newSlug && !oldSlug) {
227 227
                 this._clearHero(this.$store)
228 228
                 this.loadPostData()
229 229
             }
230
+            // ONLY load post data when navigating TO a single page from a single page
231
+            if(newSlug && oldSlug) {
232
+                this._clearHero(this.$store)
233
+                this.loadPostData()
234
+            }
230 235
         },
231 236
     },
232 237
     created() {

+ 7
- 6
vue-theme/src/store/modules/artist.js Ver fichero

@@ -19,7 +19,9 @@ const getters = {
19 19
 
20 20
 
21 21
 const _arrangeByMaterial = artistsList => {
22
-    const byMaterial = {}
22
+    const byMaterial = {
23
+        clay: []
24
+    }
23 25
     artistsList.forEach(artist => {
24 26
         artist.materials.forEach(mat => {
25 27
             if(!byMaterial[mat]) byMaterial[mat] = []
@@ -34,19 +36,18 @@ const _arrangeByMaterial = artistsList => {
34 36
     return flatPacked
35 37
 }
36 38
 
37
-let seen = 0
38
-let hasTitle = []
39
-
40 39
 const _arrangeByAlpha = artistsList => {
41 40
     const alphabet = [...'9abcdefghijklmnopqrstuvwxyz']
42 41
     const flatPacked = []
43
-    
42
+    let seen = 0
43
+    let hasTitle = []
44
+
44 45
     const storeTitle = letter => {
45 46
         if(hasTitle.includes(letter)) return
46 47
         flatPacked.push({ slug: letter, title: letter, inbetween: true })
47 48
         hasTitle.push(letter)
48 49
     }
49
-    
50
+
50 51
     artistsList.forEach((artist, i) => {
51 52
         const lastWord = artist.slug.split('-').filter(c => c).pop()
52 53
         const firstCharaOfSortWord = artist.sortname ? artist.sortname[0] : 'z'

Loading…
Cancelar
Guardar