From 18a201d2cab686e350374413630f93cfa4612b11 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 29 Nov 2023 21:01:20 -0500 Subject: exposed menu option to pin Trails and other tree view docs and added open button. Allowed trails to be pinned to or embedded within other trails. --- src/client/views/collections/CollectionTreeView.tsx | 2 +- src/client/views/collections/TabDocView.tsx | 5 +++-- src/client/views/collections/TreeView.tsx | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/client/views/collections') diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx index b34598731..5bd5cef25 100644 --- a/src/client/views/collections/CollectionTreeView.tsx +++ b/src/client/views/collections/CollectionTreeView.tsx @@ -334,7 +334,7 @@ export class CollectionTreeView extends CollectionSubView { } const anchorDoc = DocumentManager.Instance.getDocumentView(doc)?.ComponentView?.getAnchor?.(false, pinProps); const pinDoc = anchorDoc?.type === DocumentType.CONFIG ? anchorDoc : Docs.Create.ConfigDocument({}); - pinDoc.presentation_targetDoc = anchorDoc ?? doc; + const targDoc = (pinDoc.presentation_targetDoc = anchorDoc ?? doc); pinDoc.title = doc.title + ' - Slide'; - pinDoc.data = new List(); // the children of the embedding's layout are the presentation slide children. the embedding's data field might be children of a collection, PDF data, etc -- in any case we don't want the tree view to "see" this data + pinDoc.data = targDoc.type === DocumentType.PRES ? ComputedField.MakeFunction('copyField(this.presentation_targetDoc.data') : new List(); // the children of the embedding's layout are the presentation slide children. the embedding's data field might be children of a collection, PDF data, etc -- in any case we don't want the tree view to "see" this data pinDoc.presentation_movement = doc.type === DocumentType.SCRIPTING || pinProps?.pinDocLayout ? PresMovement.None : PresMovement.Zoom; pinDoc.presentation_duration = pinDoc.presentation_duration ?? 1000; pinDoc.presentation_groupWithUp = false; diff --git a/src/client/views/collections/TreeView.tsx b/src/client/views/collections/TreeView.tsx index f3e006478..03e82577e 100644 --- a/src/client/views/collections/TreeView.tsx +++ b/src/client/views/collections/TreeView.tsx @@ -976,7 +976,7 @@ export class TreeView extends React.Component { addDocument={undefined} addDocTab={this.props.addDocTab} rootSelected={returnFalse} - pinToPres={emptyFunction} + pinToPres={this.props.treeView.props.pinToPres} onClick={this.onChildClick} onDoubleClick={this.onChildDoubleClick} dragAction={this.props.dragAction} -- cgit v1.2.3-70-g09d2