mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 02:30:42 +01:00
sorting of widgets
This commit is contained in:
@@ -36,7 +36,6 @@ async function getWidgetBundlesByParent() {
|
||||
const byParent = {};
|
||||
|
||||
for (const bundle of scriptBundles) {
|
||||
|
||||
let widget;
|
||||
|
||||
try {
|
||||
@@ -47,15 +46,13 @@ async function getWidgetBundlesByParent() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!widget.getParentWidget) {
|
||||
if (!widget.parentWidget) {
|
||||
console.log(`Custom widget does not have mandatory 'getParent()' method defined`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const parentWidgetName = widget.getParentWidget();
|
||||
|
||||
byParent[parentWidgetName] = byParent[parentWidgetName] || [];
|
||||
byParent[parentWidgetName].push(widget);
|
||||
byParent[widget.parentWidget] = byParent[widget.parentWidget] || [];
|
||||
byParent[widget.parentWidget].push(widget);
|
||||
}
|
||||
|
||||
return byParent;
|
||||
|
||||
Reference in New Issue
Block a user