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'],
|
props: ['is-open'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
query: ''
|
query: '',
|
||||||
|
loading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|
@ -60,7 +61,11 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
search () {
|
search () {
|
||||||
|
this.loading = true
|
||||||
this.$store.dispatch('startQuery', this.query)
|
this.$store.dispatch('startQuery', this.query)
|
||||||
|
.then(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
close () {
|
close () {
|
||||||
this.$store.dispatch('closeSearch')
|
this.$store.dispatch('closeSearch')
|
||||||
|
|
|
||||||
|
|
@ -265,12 +265,13 @@ export default new Vuex.Store({
|
||||||
if (state.channel.uid !== null) {
|
if (state.channel.uid !== null) {
|
||||||
channel = state.channel.uid
|
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: {
|
headers: {
|
||||||
'Authorization': 'Bearer ' + this.state.access_token
|
'Authorization': 'Bearer ' + this.state.access_token
|
||||||
},
|
},
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
}).then(response => response.json())
|
})
|
||||||
|
.then(response => response.json())
|
||||||
.then(response => {
|
.then(response => {
|
||||||
commit('newSearchResults', response.items)
|
commit('newSearchResults', response.items)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user