Sfoglia il codice sorgente

:poop: adding clear hero mixin

tags/0.9.0
J 4 anni fa
parent
commit
d2f4f34df3
2 ha cambiato i file con 14 aggiunte e 6 eliminazioni
  1. 11
    6
      vue-theme/src/pages/list.vue
  2. 3
    0
      vue-theme/src/pages/mixin-post-types.js

+ 11
- 6
vue-theme/src/pages/list.vue Vedi File

101
             const dispatchAction = clear ? `getAll${this.pType}` : `getMore${this.pType}`
101
             const dispatchAction = clear ? `getAll${this.pType}` : `getMore${this.pType}`
102
             // pType sometimes is undefined so need to dispatch and
102
             // pType sometimes is undefined so need to dispatch and
103
             let res = null
103
             let res = null
104
+
104
             // Episodes only needs load call
105
             // Episodes only needs load call
105
             if(this.pType && dispatchAction != `getMoreEpisodes`) {
106
             if(this.pType && dispatchAction != `getMoreEpisodes`) {
106
-                console.log('d:', dispatchAction, this._getDispatchParams())
107
-                res = await this.$store.dispatch(dispatchAction, this._getDispatchParams())
107
+                res = await this.$store.dispatch(
108
+                    dispatchAction,
109
+                    this._getDispatchParams()
110
+                )
108
             }
111
             }
109
 
112
 
110
             // Stop trying to load more posts
113
             // Stop trying to load more posts
139
         setIntersectionLoader() {
142
         setIntersectionLoader() {
140
             console.warn('setting up intersection handler for:', this.type)
143
             console.warn('setting up intersection handler for:', this.type)
141
             window.removeEventListener("load", e => {}, false)
144
             window.removeEventListener("load", e => {}, false)
142
-            console.warn('all intersection handlers:', window)
145
+
143
             const footerEl = document.querySelector(".footer-wrapper footer")
146
             const footerEl = document.querySelector(".footer-wrapper footer")
144
             if(!footerEl) return
147
             if(!footerEl) return
145
 
148
 
146
             window.addEventListener("load", e => {
149
             window.addEventListener("load", e => {
147
                 const observer = new IntersectionObserver(this.loadMorePosts, {
150
                 const observer = new IntersectionObserver(this.loadMorePosts, {
148
-                    rootMargin: "0px 0px -20px 0px",
151
+                    rootMargin: "0px 0px 20px 0px",
149
                 })
152
                 })
150
                 observer.observe(footerEl)
153
                 observer.observe(footerEl)
151
             }, false)
154
             }, false)
167
             this.setIntersectionLoader()
170
             this.setIntersectionLoader()
168
         },
171
         },
169
     },
172
     },
170
-    created() {
171
-        console.log('--- List page ---')
173
+    mounted() {
172
         this.setIntersectionLoader()
174
         this.setIntersectionLoader()
173
     },
175
     },
176
+    created() {
177
+        console.log('--- List page ---')
178
+    }
174
 }
179
 }
175
 </script>
180
 </script>
176
 
181
 

+ 3
- 0
vue-theme/src/pages/mixin-post-types.js Vedi File

59
             json.text = post && post.excerpt ? post.excerpt : post.title
59
             json.text = post && post.excerpt ? post.excerpt : post.title
60
             return json
60
             return json
61
         },
61
         },
62
+        _clearHero(store) {
63
+            store.commit('SET_HERO', { url: null, heroType: null })
64
+        }
62
     }
65
     }
63
 }
66
 }
64
 export { postTypeGetters, scrollTop, heroUtils }
67
 export { postTypeGetters, scrollTop, heroUtils }

Loading…
Annulla
Salva