editor: avoid data shifting, reset reused children props

This commit is contained in:
jean-emmanuel 2018-10-17 15:29:43 +02:00
parent a6d449804e
commit a750083b18
2 changed files with 3 additions and 5 deletions

View file

@ -66,13 +66,9 @@ function updateWidget(widget, options={}) {
widgetManager.removeWidgets(removedWidgets)
// retreive widget's data from it's parent if possible
var parentProps = widget.getProp('type') === 'root' ? false : widget.parent.props[widget.getProp('type') == 'tab' ? 'tabs' : 'widgets'],
data = parentProps ? parentProps[index] : widget.props
// create new widget
var newWidget = parser.parse({
data: data,
data: widget.props,
parent: widget.parent,
parentNode: widget.parentNode,
reCreateOptions: options.reCreateOptions,

View file

@ -56,6 +56,7 @@ class Panel extends Container {
this.wrapper.appendChild(this.children[i].container)
this.children[i].parent = this
this.children[i].parentNode = this.wrapper
this.children[i].props = this.getProp('tabs')[i]
} else {
parser.parse({
data: this.getProp('tabs')[i],
@ -90,6 +91,7 @@ class Panel extends Container {
this.widget.appendChild(this.children[i].container)
this.children[i].parent = this
this.children[i].parentNode = this.widget
this.children[i].props = this.getProp('widgets')[i]
} else {
parser.parse({
data: this.getProp('widgets')[i],