mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 22:35:50 +01:00
refactor widget constructor
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user