aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/TabDocView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-01-11 13:57:14 -0500
committerbobzel <zzzman@gmail.com>2021-01-11 13:57:14 -0500
commit761596b7bb7b4cab18e1e1df62330a3a11a7af03 (patch)
tree4f3a23eaa177c2cd9a36efdadd89dc5a1146e318 /src/client/views/collections/TabDocView.tsx
parentb239f049578edeefc5971f3e682e3e70e2e76132 (diff)
generalized spotlight moving to be available by any document
Diffstat (limited to 'src/client/views/collections/TabDocView.tsx')
-rw-r--r--src/client/views/collections/TabDocView.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx
index 9a0759fe5..09f709a5e 100644
--- a/src/client/views/collections/TabDocView.tsx
+++ b/src/client/views/collections/TabDocView.tsx
@@ -24,7 +24,7 @@ import { Transform } from '../../util/Transform';
import { undoBatch, UndoManager } from "../../util/UndoManager";
import { DocumentView, DocAfterFocusFunc, DocumentViewProps } from "../nodes/DocumentView";
import { FieldViewProps } from '../nodes/FieldView';
-import { PresBox, PresMovement } from '../nodes/PresBox';
+import { PresBox, PresMovement, PinProps } from '../nodes/PresBox';
import { DefaultLayerProvider, DefaultStyleProvider, StyleLayers, StyleProp } from '../StyleProvider';
import { CollectionDockingView } from './CollectionDockingView';
import { CollectionDockingViewMenu } from './CollectionDockingViewMenu';
@@ -166,8 +166,8 @@ export class TabDocView extends React.Component<TabDocViewProps> {
* Adds a document to the presentation view
**/
@action
- public static async PinDoc(doc: Doc, unpin = false, audioRange?: boolean) {
- if (unpin) console.log('TODO: Remove UNPIN from this location');
+ public static async PinDoc(doc: Doc, pinProps?: PinProps) {
+ if (pinProps?.unpin) console.log('TODO: Remove UNPIN from this location');
//add this new doc to props.Document
const curPres = CurrentUserUtils.ActivePresentation;
if (curPres) {
@@ -183,21 +183,21 @@ export class TabDocView extends React.Component<TabDocViewProps> {
const size: number = PresBox.Instance?._selectedArray.size;
const presSelected: Doc | undefined = presArray && size ? presArray[size - 1] : undefined;
Doc.AddDocToList(curPres, "data", pinDoc, presSelected);
- if (!audioRange && (pinDoc.type === DocumentType.AUDIO || pinDoc.type === DocumentType.VID)) {
+ if (!pinProps?.audioRange && (pinDoc.type === DocumentType.AUDIO || pinDoc.type === DocumentType.VID)) {
pinDoc.mediaStart = "manual";
pinDoc.mediaStop = "manual";
pinDoc.presStartTime = 0;
pinDoc.presEndTime = pinDoc.type === DocumentType.AUDIO ? doc.duration : NumCast(doc["data-duration"]);
}
//save position
- if (pinDoc.isInkMask) {
+ if (pinProps?.setPosition || pinDoc.isInkMask) {
+ pinDoc.setPosition = true;
pinDoc.y = doc.y;
pinDoc.x = doc.x;
pinDoc.presHideAfter = true;
pinDoc.presHideBefore = true;
pinDoc.title = doc.title + "- Spotlight";
pinDoc.presMovement = PresMovement.None;
-
}
if (curPres.expandBoolean) pinDoc.presExpandInlineButton = true;
const dview = CollectionDockingView.Instance.props.Document;