aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/TabDocView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-12-05 14:13:02 -0500
committerbobzel <zzzman@gmail.com>2023-12-05 14:13:02 -0500
commit3f412f469925f444714fd20a9bd76f4c36029d34 (patch)
tree4c0259357586cf88e56d5d3c20177aa6ed4b71db /src/client/views/collections/TabDocView.tsx
parent304f7e25fb2a533876a59bca7215126d02d94dbf (diff)
parent23f789ab0bc9947f1bd23816183df2b5cc89b0e6 (diff)
merged with master
Diffstat (limited to 'src/client/views/collections/TabDocView.tsx')
-rw-r--r--src/client/views/collections/TabDocView.tsx13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx
index 4f3c5b9a2..def4beca3 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;
@@ -377,9 +378,9 @@ export class TabDocView extends React.Component<TabDocViewProps> {
case undefined:
case OpenWhere.lightbox: if (this.layoutDoc?._isLightbox) {
const lightboxView = !doc.annotationOn && DocCast(doc.embedContainer) ? DocumentManager.Instance.getFirstDocumentView(DocCast(doc.embedContainer)) : undefined;
- const data = lightboxView?.dataDoc[Doc.LayoutFieldKey(lightboxView.rootDoc)];
+ const data = lightboxView?.dataDoc[Doc.LayoutFieldKey(lightboxView.Document)];
if (lightboxView && (!data || data instanceof List)) {
- lightboxView.layoutDoc[Doc.LayoutFieldKey(lightboxView.rootDoc)] = new List<Doc>([doc]);
+ lightboxView.layoutDoc[Doc.LayoutFieldKey(lightboxView.Document)] = new List<Doc>([doc]);
return true;
}
}
@@ -443,7 +444,7 @@ export class TabDocView extends React.Component<TabDocViewProps> {
LayoutTemplateString={this.props.keyValue ? KeyValueBox.LayoutString() : undefined}
hideTitle={this.props.keyValue}
Document={this._document}
- DataDoc={!Doc.AreProtosEqual(this._document[DocData], this._document) ? this._document[DocData] : undefined}
+ TemplateDataDocument={!Doc.AreProtosEqual(this._document[DocData], this._document) ? this._document[DocData] : undefined}
onBrowseClick={DocumentView.exploreMode}
waitForDoubleClickToClick={this.waitForDoubleClick}
isContentActive={this.isContentActive}
@@ -459,7 +460,6 @@ export class TabDocView extends React.Component<TabDocViewProps> {
addDocTab={this.addDocTab}
ScreenToLocalTransform={this.ScreenToLocalTransform}
dontCenter={'y'}
- rootSelected={returnFalse}
whenChildContentsActiveChanged={this.whenChildContentActiveChanges}
focus={this.focusFunc}
docViewPath={returnEmptyDoclist}
@@ -598,7 +598,6 @@ export class TabMinimapView extends React.Component<TabMinimapViewProps> {
dontRegisterView={true}
fieldKey={Doc.LayoutFieldKey(this.props.document)}
bringToFront={emptyFunction}
- rootSelected={returnFalse}
addDocument={returnFalse}
moveDocument={returnFalse}
removeDocument={returnFalse}