Просмотр исходного кода

:sparkles: blocking seen letters

tags/0.9.0
J 4 лет назад
Родитель
Сommit
de5b8665b4
2 измененных файлов: 12 добавлений и 2 удалений
  1. 5
    0
      vue-theme/src/pages/list.vue
  2. 7
    2
      vue-theme/src/store/modules/artist.js

+ 5
- 0
vue-theme/src/pages/list.vue Просмотреть файл

226
             width: 100%
226
             width: 100%
227
             &.inbetween
227
             &.inbetween
228
                 grid-column: span 3
228
                 grid-column: span 3
229
+                background: white
230
+                padding: 0.3em 0
231
+                font-size: 1.3em
232
+                > p
233
+                    margin: 0
229
 
234
 
230
     /* posts in grid list */
235
     /* posts in grid list */
231
     .posts.is-grid
236
     .posts.is-grid

+ 7
- 2
vue-theme/src/store/modules/artist.js Просмотреть файл

35
 }
35
 }
36
 
36
 
37
 let seen = 0
37
 let seen = 0
38
+let hasTitle = []
38
 const _arrangeByAlpha = artistsList => {
39
 const _arrangeByAlpha = artistsList => {
39
     const alphabet = [...'9abcdefghijklmnopqrstuvwxyz']
40
     const alphabet = [...'9abcdefghijklmnopqrstuvwxyz']
40
     const flatPacked = []
41
     const flatPacked = []
49
         if(i == 0) {
50
         if(i == 0) {
50
             seen = charaIndex
51
             seen = charaIndex
51
             flatPacked.push({ slug: alphabet[seen], title: alphabet[seen], inbetween: true })
52
             flatPacked.push({ slug: alphabet[seen], title: alphabet[seen], inbetween: true })
53
+            hasTitle.push(alphabet[seen])
52
         }
54
         }
53
 
55
 
54
         if (charaIndex == seen + 1) {
56
         if (charaIndex == seen + 1) {
55
             seen++
57
             seen++
56
             if(seen > alphabet.length) { seen = 0 }
58
             if(seen > alphabet.length) { seen = 0 }
57
-
58
-            flatPacked.push({ slug: alphabet[seen], title: alphabet[seen], inbetween: true })
59
+            
60
+            if(!hasTitle.includes(alphabet[seen])) {
61
+                flatPacked.push({ slug: alphabet[seen], title: alphabet[seen], inbetween: true })
62
+                hasTitle.push(alphabet[seen])
63
+            }
59
         }
64
         }
60
         flatPacked.push(artist)
65
         flatPacked.push(artist)
61
     })
66
     })

Загрузка…
Отмена
Сохранить