diff --git a/src/client/managers/session/index.js b/src/client/managers/session/index.js index 7cf062d0..75f504a6 100644 --- a/src/client/managers/session/index.js +++ b/src/client/managers/session/index.js @@ -44,7 +44,8 @@ var SessionManager = class SessionManager { parser.reset() parser.parse({ data: this.session.getRoot(), - parentNode: DOM.get('#osc-container')[0] + parentNode: DOM.get('#osc-container')[0], + parent: widgetManager }) editor.clearHistory() DOM.get(document, '#osc-greeting-header')[0].classList.add('hidden') diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 796da493..0b060835 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -168,7 +168,7 @@ class Widget extends EventEmitter { this.widget = options.html this.props = options.props this.errors = {} - this.parent = options.root ? widgetManager : options.parent + this.parent = options.parent this.parentNode = options.parentNode this.hash = options.hash || nanoid('abcdefghijklmnopqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXYZ', 10) this.children = [] @@ -182,7 +182,7 @@ class Widget extends EventEmitter { this.createPropsCache() - if (this.getProp('id') == 'root' && !options.root) { + if (this.getProp('id') == 'root' && this.parent !== widgetManager) { this.cachedProps.id = '_root' this.errors.id = 'There can only be one root' }