docs(scripting): remove workaround for sidebar visibility

This commit is contained in:
Elian Doran
2025-11-22 11:03:00 +02:00
parent 7daee36d3e
commit 664d28f105
5 changed files with 65 additions and 57 deletions

View File

@@ -4104,31 +4104,38 @@
{
"type": "relation",
"name": "internalLink",
"value": "AlhDUqhENtH7",
"value": "2FvYrpmOXm29",
"isInheritable": false,
"position": 100
},
{
"type": "relation",
"name": "internalLink",
"value": "bwZpz2ajCEwO",
"value": "AlhDUqhENtH7",
"isInheritable": false,
"position": 110
},
{
"type": "relation",
"name": "internalLink",
"value": "KC1HB96bqqHX",
"value": "bwZpz2ajCEwO",
"isInheritable": false,
"position": 120
},
{
"type": "relation",
"name": "internalLink",
"value": "0ESUbbAxVnoK",
"value": "KC1HB96bqqHX",
"isInheritable": false,
"position": 130
},
{
"type": "relation",
"name": "internalLink",
"value": "0ESUbbAxVnoK",
"isInheritable": false,
"position": 140
},
{
"type": "label",
"name": "iconClass",
@@ -4142,13 +4149,6 @@
"value": "printing-and-pdf-export",
"isInheritable": false,
"position": 110
},
{
"type": "relation",
"name": "internalLink",
"value": "2FvYrpmOXm29",
"isInheritable": false,
"position": 140
}
],
"format": "markdown",

View File

@@ -20,14 +20,21 @@ class ToDoListWidget extends api.RightPanelWidget {
}
async refreshWithNote(note) {
this.toggleInt(false);
this.triggerCommand("reEvaluateRightPaneVisibility");
this.toggleInt(true);
this.triggerCommand("reEvaluateRightPaneVisibility");
// Do something when the note changes.
}
}
module.exports = new ToDoListWidget();
```
The implementation is in `src/public/app/widgets/right_panel_widget.js`.
The implementation is in `src/public/app/widgets/right_panel_widget.js`.
## Conditionally changing visibility
In `refreshWithNote`:
```
const visible = true; // replace with your own visibility logic
this.toggleInt(visible);
this.triggerCommand("reEvaluateRightPaneVisibility");
```