property inheritance: allow referring to a parent using its and fix infinite loop when editing (issue #122)

This commit is contained in:
jean-emmanuel 2018-01-03 10:08:56 +01:00
parent aceb8e175d
commit f2be501509
2 changed files with 13 additions and 1 deletions

View file

@ -36,6 +36,8 @@ var updateDom = function(container,data, remote) {
}
}
purgeStores(oldWidgets)
// widget
var newContainer = parser.parse([data], container[0].abstract.parentNode, container[0].abstract.parent)
container.replaceWith(newContainer)
@ -50,7 +52,6 @@ var updateDom = function(container,data, remote) {
newContainer.trigger('resize')
purgeStores(oldWidgets)
// restore state

View file

@ -159,6 +159,17 @@ module.exports = class _widgets_base {
[this.parent] : id == 'this' ? [this] :
widgetManager.getWidgetById(id)
if (!widgets.length) {
var parent = this.parent
while (parent) {
if (parent.getProp('id') == id) {
widgets.push(parent)
storeLinks = false
break
}
parent = parent.parent
}
}
for (var i in widgets) {
if (widgets[i].props.hasOwnProperty(k) || k == '_value') {