search: add "is-loading" class to button
This commit is contained in:
parent
020e901474
commit
c73efe8610
|
@ -35,7 +35,8 @@ export default {
|
|||
props: ['is-open'],
|
||||
data() {
|
||||
return {
|
||||
query: ''
|
||||
query: '',
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
@ -60,7 +61,11 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
search () {
|
||||
this.loading = true
|
||||
this.$store.dispatch('startQuery', this.query)
|
||||
.then(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
close () {
|
||||
this.$store.dispatch('closeSearch')
|
||||
|
|
11
src/store.js
11
src/store.js
|
@ -265,15 +265,16 @@ export default new Vuex.Store({
|
|||
if (state.channel.uid !== null) {
|
||||
channel = state.channel.uid
|
||||
}
|
||||
fetch(this.state.microsubEndpoint + '?action=search&channel='+channel+'&query='+query, {
|
||||
return fetch(this.state.microsubEndpoint + '?action=search&channel='+channel+'&query='+query, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.state.access_token
|
||||
},
|
||||
method: 'POST'
|
||||
}).then(response => response.json())
|
||||
.then(response => {
|
||||
commit('newSearchResults', response.items)
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(response => {
|
||||
commit('newSearchResults', response.items)
|
||||
})
|
||||
},
|
||||
createChannel(x, name) {
|
||||
let url = this.state.microsubEndpoint + '?action=channels&name=' + encodeURIComponent(name)
|
||||
|
|
Loading…
Reference in New Issue
Block a user