diff options
author | anika <anika.ahluwalia@gmail.com> | 2021-01-28 09:21:12 -0500 |
---|---|---|
committer | anika <anika.ahluwalia@gmail.com> | 2021-01-28 09:21:12 -0500 |
commit | 35e1b844c23b0f78ead7ab00ffec16c8c6460229 (patch) | |
tree | d2d9dcd87ca62cca4a02db0b55a5fe307a2926b9 /src/client/views/nodes/PresBox.tsx | |
parent | 5b0a4a154a6e68139d3d7e462ca421d3fbbdd224 (diff) | |
parent | 17bd18fd01d8b1f7fbef11d42651932d251cacc7 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into filters
Diffstat (limited to 'src/client/views/nodes/PresBox.tsx')
-rw-r--r-- | src/client/views/nodes/PresBox.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index 62e497e18..8d0283a12 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -417,15 +417,16 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema> self._dragArray.splice(0, self._dragArray.length, ...dragViewCache); self._eleArray.splice(0, self._eleArray.length, ...eleViewCache); }); - const openInTab = () => { - collectionDocView ? collectionDocView.props.addDocTab(targetDoc, "") : this.props.addDocTab(targetDoc, ":left"); + const openInTab = (doc: Doc, finished?: () => void) => { + collectionDocView ? collectionDocView.props.addDocTab(doc, "") : this.props.addDocTab(doc, ":left"); this.layoutDoc.presCollection = targetDoc; // this still needs some fixing setTimeout(resetSelection, 500); + doc !== targetDoc && setTimeout(() => finished?.(), 100); /// give it some time to create the targetDoc if we're opening up its context }; // If openDocument is selected then it should open the document for the user if (activeItem.openDocument) { - openInTab(); + openInTab(targetDoc); } else if (curDoc.presMovement === PresMovement.Pan && targetDoc) { await DocumentManager.Instance.jumpToDocument(targetDoc, false, openInTab, srcContext, undefined, undefined, undefined, includesDoc || tab ? undefined : resetSelection); // documents open in new tab instead of on right } else if ((curDoc.presMovement === PresMovement.Zoom || curDoc.presMovement === PresMovement.Jump) && targetDoc) { |