refactoring of access to options in frontend

This commit is contained in:
zadam
2019-08-22 23:31:02 +02:00
parent b84542064c
commit f9abea83f3
13 changed files with 93 additions and 62 deletions

View File

@@ -74,10 +74,13 @@ class Sidebar {
try {
const widget = new widgetClass(this.ctx, state);
await widget.renderBody();
this.widgets.push(widget);
this.$widgetContainer.append(widget.getWidgetElement());
if (await widget.isEnabled()) {
const $el = await widget.render();
this.widgets.push(widget);
this.$widgetContainer.append($el);
}
}
catch (e) {
messagingService.logError(`Error while loading widget ${widgetClass.name}: ${e.message}`);