editor: avoid data shifting, reset reused children props
This commit is contained in:
parent
ee559241a9
commit
3a35d5a0a1
2 changed files with 3 additions and 5 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue