widgets: move widget instance dom reference storing to constructor

This commit is contained in:
jean-emmanuel 2018-01-05 16:19:49 +01:00
parent 7a544b862d
commit f675e05d7e
2 changed files with 3 additions and 3 deletions

View file

@ -101,9 +101,6 @@ var WidgetManager = class WidgetManager {
this.scrollingWidgets.push(hash)
}
widget.widget.abstract = widget
if (widget.container) widget.container[0].abstract = widget
ipc.send('addWidget', {
hash:hash,
data:{

View file

@ -26,6 +26,9 @@ module.exports = class _widgets_base {
this.parentNode = options.parentNode
this.hash = _widgets_base.createHash()
this.widget.abstract = this
if (this.container) this.container[0].abstract = this
// Turn preArgs into array
if (this.props.preArgs !== undefined && !Array.isArray(this.resolveProp('preArgs', undefined, false))) {
this.props.preArgs = [this.props.preArgs]