diff options
author | Aubrey Li <Aubrey-Li> | 2022-03-03 18:12:13 -0500 |
---|---|---|
committer | Aubrey Li <Aubrey-Li> | 2022-03-03 18:12:13 -0500 |
commit | 3573a81d334cf8cc13d19b04c6f2094c24c43932 (patch) | |
tree | dc83cb0c25d0960f170058c8b25179ae5efc68a0 /src/client/views/nodes/trails/PresBox.tsx | |
parent | d010c3875b4a6b113f4f2099f201abbf1b8d4eb0 (diff) |
edit: lightbox opens tab in the same stack
Diffstat (limited to 'src/client/views/nodes/trails/PresBox.tsx')
-rw-r--r-- | src/client/views/nodes/trails/PresBox.tsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx index 14d6e8be6..48223a5f0 100644 --- a/src/client/views/nodes/trails/PresBox.tsx +++ b/src/client/views/nodes/trails/PresBox.tsx @@ -391,7 +391,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema> self._eleArray.splice(0, self._eleArray.length, ...eleViewCache); }); const openInTab = (doc: Doc, finished?: () => void) => { - collectionDocView ? collectionDocView.props.addDocTab(doc, "") : this.props.addDocTab(doc, ":left"); + collectionDocView ? collectionDocView.props.addDocTab(doc, "") : this.props.addDocTab(doc, ""); this.layoutDoc.presCollection = targetDoc; // this still needs some fixing setTimeout(resetSelection, 500); @@ -403,7 +403,12 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema> }; // If openDocument is selected then it should open the document for the user if (activeItem.openDocument) { - LightboxView.SetLightboxDoc(targetDoc); + // LightboxView.SetLightboxDoc(targetDoc); + // activeItem: "slide in the sidebar" --> maps to target document (targetDoc) in the canvas + console.log(activeItem); + console.log("openDocument triggered"); + + openInTab(targetDoc); } else if (curDoc.presMovement === PresMovement.Pan && targetDoc) { LightboxView.SetLightboxDoc(undefined); await DocumentManager.Instance.jumpToDocument(targetDoc, false, openInTab, srcContext, undefined, undefined, undefined, includesDoc || tab ? undefined : resetSelection, undefined, true); // documents open in new tab instead of on right |