From 5a4eb64c2e19aa872f6f97e7c7e3e59382811a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Tue, 19 Nov 2024 12:56:49 +0100 Subject: [PATCH] Fix duplicate color picker saveColor method --- .../components/input/CInputColorPicker.vue | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/lib/vue/src/components/input/CInputColorPicker.vue b/lib/vue/src/components/input/CInputColorPicker.vue index f5bd7f471..a64c3ccc3 100644 --- a/lib/vue/src/components/input/CInputColorPicker.vue +++ b/lib/vue/src/components/input/CInputColorPicker.vue @@ -48,7 +48,10 @@ /> - + {{ value }} @@ -147,16 +150,17 @@ export default { translations: { type: Object, + default: () => ({}), }, width: { type: String, - default: "32px", + default: '32px', }, height: { type: String, - default: "32px", + default: '32px', }, showText: { @@ -166,7 +170,7 @@ export default { themeSettings: { type: Array, - default: [], + default: () => [], }, themeVariables: { @@ -205,7 +209,7 @@ export default { label: 'Extra light', }, ], - } + }, }, data () { @@ -218,13 +222,13 @@ export default { computed: { themes () { return this.themeSettings - .filter((theme) => theme.id !== 'general') // remove general theme - .map((theme) => { - return { - id: theme.id, - values: JSON.parse(theme.values), - } - }) + .filter((theme) => theme.id !== 'general') // remove general theme + .map((theme) => { + return { + id: theme.id, + values: JSON.parse(theme.values), + } + }) }, }, @@ -259,11 +263,6 @@ export default { } }, - saveColor () { - this.$emit('input', this.currentColor || this.value) - this.closeMenu() - }, - openMenu () { this.showModal = true },