diff options
| author | bobzel <zzzman@gmail.com> | 2023-02-28 20:57:01 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2023-02-28 20:57:01 -0500 |
| commit | 5e7989da274606638c96f649e97e9d1a979956f5 (patch) | |
| tree | 80a10b9a47e9874c3ec8dacdc26210836bbe3fe8 /src/client/views/collections/TabDocView.tsx | |
| parent | f1dea8f31886c1e5e3d8bb772434009803b8fb8a (diff) | |
cleaning up of following inPlace links to overlay current inplaceContainer contents instead of deleting them.
Diffstat (limited to 'src/client/views/collections/TabDocView.tsx')
| -rw-r--r-- | src/client/views/collections/TabDocView.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx index b75f315ca..01872df84 100644 --- a/src/client/views/collections/TabDocView.tsx +++ b/src/client/views/collections/TabDocView.tsx @@ -358,7 +358,17 @@ export class TabDocView extends React.Component<TabDocViewProps> { if (doc.dockingConfig) return DashboardView.openDashboard(doc); // prettier-ignore switch (whereFields[0]) { - case OpenWhere.inPlace: // fall through to lightbox + case undefined: + case OpenWhere.inPlace: { + if (this.layoutDoc?.isInPlaceContainer) { + const inPlaceView = !doc.annotationOn && DocCast(doc.context) ? DocumentManager.Instance.getFirstDocumentView(DocCast(doc.context)) : undefined; + const data = inPlaceView?.dataDoc[Doc.LayoutFieldKey(inPlaceView.rootDoc)]; + if (inPlaceView && (!data || data instanceof List)) { + inPlaceView.layoutDoc[Doc.LayoutFieldKey(inPlaceView.rootDoc)] = new List<Doc>([doc]); + return true; + } + } + } case OpenWhere.lightbox: return LightboxView.AddDocTab(doc, location); case OpenWhere.dashboard: return DashboardView.openDashboard(doc); case OpenWhere.fullScreen: return CollectionDockingView.OpenFullScreen(doc); |
