Former-commit-id: ac9399efef37f13706590384e29295c6234acb7c [formerly f62dcb89aa49125769405c502688f3f8d4348da3] [formerly 4b9f0fd696f449c30da2d2f7a11cf5d6c7054c54 [formerly 64e70e39dc]]
Former-commit-id: 422165231c785b121b1f6725909d3ce7c8dcdfee [formerly 2b26582a03f674d40abb39e27b2cc880d2bd3ebb]
Former-commit-id: ee743808a3c012514c9b7d57a34c79e408a8a78b
55 lines
1.4 KiB
JavaScript
55 lines
1.4 KiB
JavaScript
const mutations = {
|
|
closeHovers: state => {
|
|
state.show = null
|
|
state.showMessage = null
|
|
},
|
|
showHover: (state, value) => {
|
|
if (typeof value !== 'object') {
|
|
state.show = value
|
|
return
|
|
}
|
|
|
|
state.show = value.prompt
|
|
state.showMessage = value.message
|
|
},
|
|
showError: (state, value) => {
|
|
state.show = 'error'
|
|
state.showMessage = value
|
|
},
|
|
showSuccess: (state, value) => {
|
|
state.show = 'success'
|
|
state.showMessage = value
|
|
},
|
|
setLoading: (state, value) => { state.loading = value },
|
|
setReload: (state, value) => { state.reload = value },
|
|
setUser: (state, value) => (state.user = value),
|
|
setUserCSS: (state, value) => (state.user.css = value),
|
|
setJWT: (state, value) => (state.jwt = value),
|
|
multiple: (state, value) => (state.multiple = value),
|
|
addSelected: (state, value) => (state.selected.push(value)),
|
|
removeSelected: (state, value) => {
|
|
let i = state.selected.indexOf(value)
|
|
if (i === -1) return
|
|
state.selected.splice(i, 1)
|
|
},
|
|
resetSelected: (state) => {
|
|
state.selected = []
|
|
},
|
|
listingDisplay: (state, value) => {
|
|
state.req.display = value
|
|
},
|
|
updateRequest: (state, value) => {
|
|
state.req = value
|
|
},
|
|
updateClipboard: (state, value) => {
|
|
state.clipboard.key = value.key
|
|
state.clipboard.items = value.items
|
|
},
|
|
resetClipboard: (state) => {
|
|
state.clipboard.key = ''
|
|
state.clipboard.items = []
|
|
}
|
|
}
|
|
|
|
export default mutations
|