aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DashboardView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-08-26 11:22:38 -0400
committerbobzel <zzzman@gmail.com>2024-08-26 11:22:38 -0400
commitcc3e1bc2c317cf34aba04e4935ae842b16ad4cae (patch)
tree07d4e2b143dce4ac74942d970de41c18f6eabf6b /src/client/views/DashboardView.tsx
parent6bc79c5dfc5f61bf5d1b1544d399703c8006b898 (diff)
cleanup of setting myXXstuff on dashboards
Diffstat (limited to 'src/client/views/DashboardView.tsx')
-rw-r--r--src/client/views/DashboardView.tsx12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/client/views/DashboardView.tsx b/src/client/views/DashboardView.tsx
index f4fc8ee9f..4616e15e5 100644
--- a/src/client/views/DashboardView.tsx
+++ b/src/client/views/DashboardView.tsx
@@ -426,16 +426,14 @@ export class DashboardView extends ObservableReactComponent<object> {
const dashboardDoc = DashboardView.StandardCollectionDockingDocument([{ doc: freeformDoc, initialWidth: 600 }], { title: title }, id, 'row');
Doc.AddDocToList(Doc.MyHeaderBar, 'data', freeformDoc, undefined, undefined, true);
+ Doc.AddDocToList(Doc.MyDashboards, 'data', dashboardDoc);
dashboardDoc.pane_count = 1;
freeformDoc.embedContainer = dashboardDoc;
dashboardDoc.myOverlayDocs = new List<Doc>();
dashboardDoc[DocData].myPublishedDocs = new List<Doc>();
dashboardDoc[DocData].myTagCollections = new List<Doc>();
-
- Doc.AddDocToList(Doc.MyDashboards, 'data', dashboardDoc);
-
- DashboardView.SetupDashboardTrails(dashboardDoc);
- DashboardView.SetupDashboardCalendars(dashboardDoc);
+ dashboardDoc[DocData].myTrails = DashboardView.SetupDashboardTrails(dashboardDoc);
+ dashboardDoc[DocData].myCalendars = DashboardView.SetupDashboardCalendars(dashboardDoc);
// open this new dashboard
Doc.ActiveDashboard = dashboardDoc;
Doc.ActivePage = 'dashboard';
@@ -468,7 +466,7 @@ export class DashboardView extends ObservableReactComponent<object> {
};
const myCalendars = DocUtils.AssignScripts(Docs.Create.CalendarCollectionDocument([], reqdOpts));
// { treeView_ChildDoubleClick: 'openPresentation(documentView.rootDoc)' }
- dashboardDoc[DocData].myCalendars = new PrefetchProxy(myCalendars);
+ return new PrefetchProxy(myCalendars);
}
public static SetupDashboardTrails(dashboardDoc: Doc) {
@@ -514,12 +512,12 @@ export class DashboardView extends ObservableReactComponent<object> {
layout_explainer: 'All of the trails that you have created will appear here.',
};
const myTrails = DocUtils.AssignScripts(Docs.Create.TreeDocument([], reqdOpts), { treeView_ChildDoubleClick: 'openPresentation(documentView.Document)' });
- dashboardDoc.myTrails = new PrefetchProxy(myTrails);
const contextMenuScripts = [reqdBtnScript.onClick];
if (Cast(myTrails.contextMenuScripts, listSpec(ScriptField), null)?.length !== contextMenuScripts.length) {
myTrails.contextMenuScripts = new List<ScriptField>(contextMenuScripts.map(script => ScriptField.MakeFunction(script)!));
}
+ return new PrefetchProxy(myTrails);
}
}