property inheritance: trigger 'widget-created' after widget manager registration avoid ignoring widgets in resolveProp

This commit is contained in:
jean-emmanuel 2018-01-04 09:12:53 +01:00
parent 80c3ab8aa0
commit 0b01829a1c
3 changed files with 9 additions and 3 deletions

View file

@ -82,6 +82,8 @@ var Parser = class Parser {
widgetContainer[0].setAttribute('data-widget', widgetInner.hash)
widgetInner.created()
// dimensions / coordinates can't be < 0
for (let t of ['width', 'height', 'top', 'left']) {
if (props.hasOwnProperty(t))

View file

@ -81,8 +81,6 @@ module.exports = class _widgets_base {
}
$('body').trigger({type: 'widget-created', id: this.getProp('id'), widget:this})
// cache precision
if (this.props.precision != undefined) {
this.precision = Math.min(20,Math.max(this.getProp('precision', undefined, false),0))
@ -90,6 +88,12 @@ module.exports = class _widgets_base {
}
created() {
$('body').trigger({type: 'widget-created', id: this.getProp('id'), widget:this})
}
sendValue(overrides) {
var data = {

View file

@ -110,7 +110,7 @@ module.exports = class Panel extends _widgets_base {
}
}
if (edited) $('body').trigger({type: 'widget-created', id: this.getProp('id'), widget:this})
if (edited) this.created()
if (edited && this.parent && this.parent.registerHashes) this.parent.registerHashes(true)
}