refactor: update color modes handling

This commit is contained in:
mrholek
2023-06-13 15:08:59 +02:00
parent bf6a0f745a
commit 3b88337579
4 changed files with 41 additions and 7 deletions
+11 -6
View File
@@ -386,12 +386,17 @@ export default {
onMounted(() => {
document.documentElement.addEventListener('ColorSchemeChange', () => {
widgetChartRef1.value.chart.data.datasets[0].pointBackgroundColor =
getStyle('--cui-primary')
widgetChartRef2.value.chart.data.datasets[0].pointBackgroundColor =
getStyle('--cui-info')
widgetChartRef1.value.chart.update()
widgetChartRef2.value.chart.update()
if (widgetChartRef1.value) {
widgetChartRef1.value.chart.data.datasets[0].pointBackgroundColor =
getStyle('--cui-primary')
widgetChartRef1.value.chart.update()
}
if (widgetChartRef2.value) {
widgetChartRef2.value.chart.data.datasets[0].pointBackgroundColor =
getStyle('--cui-info')
widgetChartRef2.value.chart.update()
}
})
})