added ability to pick the style of highlighting

This commit is contained in:
Henry Jameson 2018-08-05 05:18:04 +03:00
parent d886ab752c
commit 6a81aa2745
6 changed files with 79 additions and 35 deletions

View file

@ -20,9 +20,12 @@ const config = {
setOption (state, { name, value }) {
set(state, name, value)
},
setHighlight (state, { user, color }) {
if (color) {
set(state.highlight, user, color)
setHighlight (state, { user, color, type }) {
const data = this.state.config.highlight[user]
console.log(user, color, type, data)
if (color || type) {
set(state.highlight, user, { color: color || data.color, type: type || data.type })
} else {
del(state.highlight, user)
}
@ -32,8 +35,8 @@ const config = {
setPageTitle ({state}, option = '') {
document.title = `${option} ${state.name}`
},
setHighlight ({ commit, dispatch }, { user, color }) {
commit('setHighlight', {user, color})
setHighlight ({ commit, dispatch }, { user, color, type }) {
commit('setHighlight', {user, color, type})
},
setOption ({ commit, dispatch }, { name, value }) {
commit('setOption', {name, value})