Commit 5369abaa authored by Jörg Richter's avatar Jörg Richter

Fix: saving a cleared color value (closes #206)

parent 12083e37
Pipeline #6392 passed with stages
in 2 minutes and 57 seconds
<template>
<div :class="['dm5-color-picker', mode]">
<template v-if="infoMode">
<div class="color-box" :style="style"></div>
<div class="color-box" :style="{'background-color': object.value}"></div>
<div class="color-value">{{object.value}}</div>
</template>
<template v-else>
<el-color-picker v-model="object.value" :predefine="colors" size="medium"></el-color-picker>
<el-color-picker v-model="object.value" :predefine="colors" size="medium" @input="input"></el-color-picker>
<el-input class="color-value" v-model="object.value"></el-input>
</template>
</div>
......@@ -45,9 +45,13 @@ export default {
]
}),
computed: {
style () {
return {'background-color': this.object.value}
methods: {
input () {
// Note: an <el-color-picker> represents a cleared value as null.
// A serialized object sent to the server must not contain JSON null, but ''.
if (this.object.value === null) {
this.object.value = ''
}
}
}
}
......
......@@ -9,7 +9,7 @@ import 'font-awesome/css/font-awesome.css'
import './element-ui'
import './websocket'
console.log('[DMX] 2019/05/17')
console.log('[DMX] 2019/05/19')
// 1) Init dm5 library
// The dm5 library must be inited *before* the dm5-webclient component is instantiated.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment