aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentButtonBar.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-04-14 18:35:49 -0400
committerbobzel <zzzman@gmail.com>2025-04-14 18:35:49 -0400
commitd818ef151ca65008e5c6bb5e92b709decb3026d8 (patch)
treeae1d821c717cfb4b38c36b519d03b45ed90e9831 /src/client/views/DocumentButtonBar.tsx
parent1525fe600142d955fa24e939322f45cbca9d1cba (diff)
fixed how templates are expanded to avoid template sub-component conflicts by changing how field keys are named. fixed various Cast functions to be more typesafe by including undefined as part of return type. overhaul of Doc.MakeClone, MakeCopy, FindRefernces - makeClone is no longer async. fixed inlined docs in text docs.
Diffstat (limited to 'src/client/views/DocumentButtonBar.tsx')
-rw-r--r--src/client/views/DocumentButtonBar.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index 6f2f051cd..8a850467a 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -303,7 +303,7 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (
DocumentView.Selected().forEach(dv => {
dv.layoutDoc._layout_showTags = !showing;
if (e.shiftKey)
- DocListCast(dv.Document[Doc.LayoutFieldKey(dv.Document) + '_annotations']).forEach(doc => {
+ DocListCast(dv.Document[Doc.LayoutDataKey(dv.Document) + '_annotations']).forEach(doc => {
if (doc.face) doc.hidden = showing;
});
});
@@ -479,13 +479,13 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (
const doc = rootView?.Document;
if (doc) {
const anchor = rootView.ComponentView?.getAnchor?.(true) ?? doc;
- const trail = DocCast(anchor.presentationTrail) ?? Doc.MakeCopy(DocCast(Doc.UserDoc().emptyTrail), true);
+ const trail = DocCast(anchor.presentationTrail) ?? (DocCast(Doc.UserDoc().emptyTrail) ? Doc.MakeCopy(DocCast(Doc.UserDoc().emptyTrail)!, true) : undefined);
if (trail !== anchor.presentationTrail) {
- DocUtils.MakeLink(anchor, trail, { link_relationship: 'link trail' });
+ trail && DocUtils.MakeLink(anchor, trail, { link_relationship: 'link trail' });
anchor.presentationTrail = trail;
}
Doc.ActivePresentation = trail;
- this._props.views().lastElement()?._props.addDocTab(trail, OpenWhere.replaceRight);
+ trail && this._props.views().lastElement()?._props.addDocTab(trail, OpenWhere.replaceRight);
}
e.stopPropagation();
};