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

View File

@ -546,12 +546,12 @@ export default {
currentDisplayElement: {
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) {
if (this.displayElements.currentIndex !== undefined) {
this.currentDisplayElements[this.displayElements.currentIndex] = element
this.currentBlock.elements.splice(this.displayElements.currentIndex, 1, element)
}
},
},