From 6a81aa274533b6af1f2514508f6f9fa3b0795c9f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 5 Aug 2018 05:18:04 +0300 Subject: added ability to pick the style of highlighting --- src/modules/config.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/modules/config.js') diff --git a/src/modules/config.js b/src/modules/config.js index 20e58250..2d597640 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -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}) -- cgit v1.2.3-70-g09d2