aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-11-29 21:01:20 -0500
committerbobzel <zzzman@gmail.com>2023-11-29 21:01:20 -0500
commit18a201d2cab686e350374413630f93cfa4612b11 (patch)
treeb1cb600dcd383aa6d1a0cf0c049bb07ed5d7330d /src/client/views/collections
parent48b0153d814cddad71caa8103e7ff4c761b66eaa (diff)
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.
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionTreeView.tsx2
-rw-r--r--src/client/views/collections/TabDocView.tsx5
-rw-r--r--src/client/views/collections/TreeView.tsx2
3 files changed, 5 insertions, 4 deletions
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<Partial<collectionTree
moveDocument={this.props.moveDocument}
removeDocument={this.props.removeDocument}
addDocTab={this.props.addDocTab}
- pinToPres={emptyFunction}
+ pinToPres={this.props.pinToPres}
rootSelected={this.props.isSelected}
ScreenToLocalTransform={Transform.Identity}
PanelWidth={this.return35}
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx
index 4f3c5b9a2..8abfddcd6 100644
--- a/src/client/views/collections/TabDocView.tsx
+++ b/src/client/views/collections/TabDocView.tsx
@@ -35,6 +35,7 @@ import { CollectionView } from './CollectionView';
import './TabDocView.scss';
import React = require('react');
import { Docs } from '../../documents/Documents';
+import { ComputedField } from '../../../fields/ScriptField';
const _global = (window /* browser */ || global) /* node */ as any;
interface TabDocViewProps {
@@ -261,9 +262,9 @@ export class TabDocView extends React.Component<TabDocViewProps> {
}
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<Doc>(); // 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<Doc>(); // 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<TreeViewProps> {
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}