3
0

Fix chart display element options not saving on create

This commit is contained in:
Jože Fortun 2022-12-02 16:44:59 +01:00
parent 03e194ffb6
commit 46cb048be2
2 changed files with 6 additions and 8 deletions

View File

@ -1,7 +1,5 @@
<template> <template>
<div <div>
v-if="options"
>
<div <div
class="mb-3" class="mb-3"
> >
@ -16,7 +14,7 @@
label-class="text-primary" label-class="text-primary"
> >
<b-form-select <b-form-select
v-model="options.type" :value="displayElementOptions.type"
:options="chartTypes" :options="chartTypes"
@change="typeChanged" @change="typeChanged"
/> />
@ -445,8 +443,8 @@ export default {
this.options.colorScheme = (colorscheme || {}).value || '' this.options.colorScheme = (colorscheme || {}).value || ''
}, },
typeChanged () { typeChanged (type) {
this.options = reporter.ChartOptionsMaker(this.options) || {} this.options = reporter.ChartOptionsMaker({ ...this.options, type })
}, },
}, },
} }

View File

@ -546,12 +546,12 @@ export default {
currentDisplayElement: { currentDisplayElement: {
get () { get () {
return this.displayElements.currentIndex !== undefined ? this.currentDisplayElements[this.displayElements.currentIndex] : undefined return this.displayElements.currentIndex !== undefined ? this.currentBlock.elements[this.displayElements.currentIndex] : undefined
}, },
set (element) { set (element) {
if (this.displayElements.currentIndex !== undefined) { if (this.displayElements.currentIndex !== undefined) {
this.currentDisplayElements[this.displayElements.currentIndex] = element this.currentBlock.elements.splice(this.displayElements.currentIndex, 1, element)
} }
}, },
}, },