aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/collections/TabDocView.tsx12
-rw-r--r--src/client/views/nodes/PresBox.tsx106
-rw-r--r--src/client/views/presentationview/PresElementBox.tsx2
3 files changed, 60 insertions, 60 deletions
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx
index 338b1d590..9c5f7c66e 100644
--- a/src/client/views/collections/TabDocView.tsx
+++ b/src/client/views/collections/TabDocView.tsx
@@ -124,7 +124,7 @@ export class TabDocView extends React.Component<TabDocViewProps> {
**/
@undoBatch
@action
- public static async PinDoc(doc: Doc, unpin = false, audioRange?: boolean) {
+ public static PinDoc(doc: Doc, unpin = false, audioRange?: boolean) {
if (unpin) console.log('TODO: Remove UNPIN from this location');
//add this new doc to props.Document
const curPres = CurrentUserUtils.ActivePresentation;
@@ -140,11 +140,15 @@ export class TabDocView extends React.Component<TabDocViewProps> {
pinDoc.presEndTime = doc.duration;
}
if (curPres.expandBoolean) pinDoc.presExpandInlineButton = true;
- const curPresDocView = DocumentManager.Instance.getDocumentView(curPres);
- if (!curPresDocView) {
+ const dview = CollectionDockingView.Instance.props.Document;
+ const fieldKey = CollectionDockingView.Instance.props.fieldKey;
+ const sublists = DocListCast(dview[fieldKey]);
+ const tabs = Cast(sublists[0], Doc, null);
+ const tabdocs = DocListCast(tabs.data);
+ if (!tabdocs.includes(curPres)) {
CollectionDockingView.AddSplit(curPres, "right");
}
- await DocumentManager.Instance.jumpToDocument(doc, false, undefined);
+ DocumentManager.Instance.jumpToDocument(doc, false, undefined);
}
}
diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx
index b19cba585..d38e48974 100644
--- a/src/client/views/nodes/PresBox.tsx
+++ b/src/client/views/nodes/PresBox.tsx
@@ -305,7 +305,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
const presDocView = DocumentManager.Instance.getDocumentView(this.rootDoc);
if (presDocView) SelectionManager.SelectDoc(presDocView, false);
this.rootDoc.presStatus = presStatus;
- }, 2000)
+ }, 2000);
} else
//docToJump stayed same meaning, it was not in the group or was the last element in the group
if (activeItem.zoomProgressivize && this.rootDoc.presStatus !== PresStatus.Edit) {
@@ -583,24 +583,26 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
doc.presMovement = PresMovement.None;
break;
}
- })
- } else if (this._selectedArray) this._selectedArray.forEach((doc) => {
- switch (movement) {
- case PresMovement.Zoom: //Pan and zoom
- doc.presMovement = PresMovement.Zoom;
- break;
- case PresMovement.Pan: //Pan
- doc.presMovement = PresMovement.Pan;
- break;
- case PresMovement.Jump: //Jump Cut
- doc.presJump = true;
- doc.presMovement = PresMovement.Jump;
- break;
- case PresMovement.None: default:
- doc.presMovement = PresMovement.None;
- break;
- }
- })
+ });
+ } else {
+ this._selectedArray?.forEach((doc) => {
+ switch (movement) {
+ case PresMovement.Zoom: //Pan and zoom
+ doc.presMovement = PresMovement.Zoom;
+ break;
+ case PresMovement.Pan: //Pan
+ doc.presMovement = PresMovement.Pan;
+ break;
+ case PresMovement.Jump: //Jump Cut
+ doc.presJump = true;
+ doc.presMovement = PresMovement.Jump;
+ break;
+ case PresMovement.None: default:
+ doc.presMovement = PresMovement.None;
+ break;
+ }
+ });
+ }
});
setMovementName = action((movement: any, activeItem: Doc): string => {
@@ -892,9 +894,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
if (change) timeInMS += change;
if (timeInMS < 100) timeInMS = 100;
if (timeInMS > 10000) timeInMS = 10000;
- if (this._selectedArray) this._selectedArray.forEach((doc) => {
- doc.presTransition = timeInMS;
- })
+ this._selectedArray?.forEach((doc) => doc.presTransition = timeInMS);
}
// Converts seconds to ms and updates presDuration
@@ -904,25 +904,19 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
if (change) timeInMS += change;
if (timeInMS < 100) timeInMS = 100;
if (timeInMS > 20000) timeInMS = 20000;
- if (this._selectedArray) this._selectedArray.forEach((doc) => {
- doc.presDuration = timeInMS;
- })
+ this._selectedArray?.forEach((doc) => doc.presDuration = timeInMS);
}
@undoBatch
updateHideBefore = (activeItem: Doc) => {
activeItem.presHideTillShownButton = !activeItem.presHideTillShownButton;
- this._selectedArray.forEach((doc) => {
- doc.presHideTillShownButton = activeItem.presHideTillShownButton;
- });
+ this._selectedArray?.forEach((doc) => doc.presHideTillShownButton = activeItem.presHideTillShownButton);
}
@undoBatch
updateHideAfter = (activeItem: Doc) => {
activeItem.presHideAfterButton = !activeItem.presHideAfterButton;
- this._selectedArray.forEach((doc) => {
- doc.presHideAfterButton = activeItem.presHideAfterButton;
- });
+ this._selectedArray?.forEach((doc) => doc.presHideAfterButton = activeItem.presHideAfterButton);
}
@undoBatch
@@ -958,30 +952,32 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
tagDoc.presEffect = PresEffect.None;
break;
}
- })
- } else if (this._selectedArray) this._selectedArray.forEach((doc) => {
- const tagDoc = Cast(doc.presentationTargetDoc, Doc, null);
- switch (effect) {
- case PresEffect.Bounce:
- tagDoc.presEffect = PresEffect.Bounce;
- break;
- case PresEffect.Fade:
- tagDoc.presEffect = PresEffect.Fade;
- break;
- case PresEffect.Flip:
- tagDoc.presEffect = PresEffect.Flip;
- break;
- case PresEffect.Roll:
- tagDoc.presEffect = PresEffect.Roll;
- break;
- case PresEffect.Rotate:
- tagDoc.presEffect = PresEffect.Rotate;
- break;
- case PresEffect.None: default:
- tagDoc.presEffect = PresEffect.None;
- break;
- }
- })
+ });
+ } else {
+ this._selectedArray?.forEach((doc) => {
+ const tagDoc = Cast(doc.presentationTargetDoc, Doc, null);
+ switch (effect) {
+ case PresEffect.Bounce:
+ tagDoc.presEffect = PresEffect.Bounce;
+ break;
+ case PresEffect.Fade:
+ tagDoc.presEffect = PresEffect.Fade;
+ break;
+ case PresEffect.Flip:
+ tagDoc.presEffect = PresEffect.Flip;
+ break;
+ case PresEffect.Roll:
+ tagDoc.presEffect = PresEffect.Roll;
+ break;
+ case PresEffect.Rotate:
+ tagDoc.presEffect = PresEffect.Rotate;
+ break;
+ case PresEffect.None: default:
+ tagDoc.presEffect = PresEffect.None;
+ break;
+ }
+ });
+ }
}
@computed get transitionDropdown() {
diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx
index 33b67ae69..6ebb7d623 100644
--- a/src/client/views/presentationview/PresElementBox.tsx
+++ b/src/client/views/presentationview/PresElementBox.tsx
@@ -266,7 +266,7 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps, PresDoc
@computed
get toolbarWidth(): number {
- const presBoxDocView = DocumentManager.Instance.getDocumentView(this.presBox)
+ const presBoxDocView = DocumentManager.Instance.getDocumentView(this.presBox);
let width: number = NumCast(this.presBox._width);
if (presBoxDocView) width = presBoxDocView.props.PanelWidth();
return width;