refactor widget constructor

This commit is contained in:
zadam
2019-08-17 10:45:20 +02:00
parent 723fc42d88
commit 53c4bb8a94
6 changed files with 15 additions and 32 deletions

View File

@@ -41,9 +41,15 @@ class StandardWidget {
this.$widget.on('shown.bs.collapse', () => this.ctx.stateChanged());
this.$widget.on('hidden.bs.collapse', () => this.ctx.stateChanged());
this.$title = this.$widget.find('.widget-title');
this.$title.text(this.getWidgetTitle());
this.$headerActions = this.$widget.find('.widget-header-actions');
this.$headerActions.append(...this.getHeaderActions());
}
getWidgetTitle() { return "Untitled widget"; }
getHeaderActions() { return []; }
async renderBody() {
if (!this.isVisible() || this.rendered) {
return;