aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PropertiesDocContextSelector.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-04-13 22:22:07 -0400
committerbobzel <zzzman@gmail.com>2023-04-13 22:22:07 -0400
commit5cd64622f14ede408d3baca4a10d155b60392e46 (patch)
tree53a576d45388cf73767f0f102bb29dd96e899717 /src/client/views/PropertiesDocContextSelector.tsx
parent5d1e3710a015d8915bd367ece753817d84d9d916 (diff)
lots of changes to get rid of ContainingCollectionDoc and ContainingCollectionView props.
Diffstat (limited to 'src/client/views/PropertiesDocContextSelector.tsx')
-rw-r--r--src/client/views/PropertiesDocContextSelector.tsx22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/client/views/PropertiesDocContextSelector.tsx b/src/client/views/PropertiesDocContextSelector.tsx
index 2c7da5931..93eec61f3 100644
--- a/src/client/views/PropertiesDocContextSelector.tsx
+++ b/src/client/views/PropertiesDocContextSelector.tsx
@@ -22,9 +22,9 @@ export class PropertiesDocContextSelector extends React.Component<PropertiesDocC
@computed get _docs() {
if (!this.props.DocView) return [];
const target = this.props.DocView.props.Document;
- const targetContext = this.props.DocView.props.ContainingCollectionDoc;
+ const targetContext = this.props.DocView.props.docViewPath().lastElement()?.rootDoc;
const aliases = DocListCast(target.aliases);
- const containerProtos = aliases.filter(alias => alias.context && alias.context instanceof Doc && Cast(alias.context, Doc, null) !== targetContext).reduce((set, alias) => set.add(Cast(alias.context, Doc, null)), new Set<Doc>());
+ const containerProtos = aliases.filter(alias => alias.context && alias.context instanceof Doc).reduce((set, alias) => set.add(Cast(alias.context, Doc, null)), new Set<Doc>());
const containerSets = Array.from(containerProtos.keys()).map(container => DocListCast(container.aliases));
const containers = containerSets.reduce((p, set) => {
set.map(s => p.add(s));
@@ -42,6 +42,7 @@ export class PropertiesDocContextSelector extends React.Component<PropertiesDocC
return doclayouts
.filter(doc => !Doc.AreProtosEqual(doc, CollectionDockingView.Instance?.props.Document))
.filter(doc => !Doc.IsSystem(doc))
+ .filter(doc => doc !== targetContext)
.map(doc => ({ col: doc, target }));
}
@@ -53,8 +54,21 @@ export class PropertiesDocContextSelector extends React.Component<PropertiesDocC
col._panY = NumCast(target.y) + NumCast(target._height) / 2;
}
col.hidden = false;
- this.props.addDocTab(col, (OpenWhere.toggle + ':' + OpenWhereMod.right) as OpenWhere);
- setTimeout(() => DocFocusOrOpen(Doc.GetProto(this.props.DocView!.props.Document), col), 100);
+ //this.props.addDocTab(col, (OpenWhere.toggle + ':' + OpenWhereMod.right) as OpenWhere);
+ setTimeout(
+ () =>
+ this.props.DocView &&
+ DocFocusOrOpen(
+ Doc.GetProto(this.props.DocView.props.Document),
+ {
+ //
+ willZoomCentered: true,
+ openLocation: (OpenWhere.toggle + ':' + OpenWhereMod.right) as OpenWhere,
+ },
+ col
+ ),
+ 100
+ );
};
render() {