mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 22:35:50 +01:00
widget can be also enabled/disabled using labels
This commit is contained in:
@@ -89,7 +89,16 @@ class StandardWidget {
|
||||
async doRenderBody() {}
|
||||
|
||||
async isEnabled() {
|
||||
return this.widgetOptions.enabled;
|
||||
const label = await this.ctx.note.getLabelValue(this.widgetName);
|
||||
|
||||
if (label === 'enabled') {
|
||||
return true;
|
||||
} else if (label === 'disabled') {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return this.widgetOptions.enabled;
|
||||
}
|
||||
}
|
||||
|
||||
isExpanded() {
|
||||
|
||||
Reference in New Issue
Block a user