aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DocumentView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r--src/client/views/nodes/DocumentView.tsx12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index c2b9dcbbd..4e13b0ccb 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -1469,17 +1469,11 @@ export class DocumentView extends ObservableReactComponent<DocumentViewProps> {
return <DocumentLinksButton hideCount={this.hideLinkCount} View={this} scaling={this.screenToLocalScale} OnHover={true} Bottom={this.topMost} ShowCount={true} />;
}
/**
- * path of DocumentViews terminating in the DocumentView that contains this DocumentView
+ * path of DocumentViews hat contains this DocumentView (does not includes this DocumentView thouhg)
*/
@computed get containerViewPath() {
return this._props.containerViewPath;
}
- /**
- * path of DocumentViews terminating in this DocumentView
- */
- @computed get docViewPath(): DocumentView[] {
- return this.containerViewPath ? [...this.containerViewPath(), this] : [this];
- }
@computed get layoutDoc() {
return Doc.Layout(this.Document, this._props.LayoutTemplate?.());
}
@@ -1607,7 +1601,7 @@ export class DocumentView extends ObservableReactComponent<DocumentViewProps> {
layout_fitWidthFunc = (doc: Doc) => BoolCast(this.layout_fitWidth);
screenToLocalScale = () => this._props.ScreenToLocalTransform().Scale;
- docViewPathFunc = () => this.docViewPath;
+ docViewPath = () => (this.containerViewPath ? [...this.containerViewPath(), this] : [this]);
isSelected = () => this.IsSelected;
select = (extendSelection: boolean, focusSelection?: boolean) => {
if (this.IsSelected && SelectionManager.Views.length > 1) SelectionManager.DeselectView(this);
@@ -1706,7 +1700,7 @@ export class DocumentView extends ObservableReactComponent<DocumentViewProps> {
<DocumentViewInternal
{...this._props}
DocumentView={this.selfView}
- docViewPath={this.docViewPathFunc}
+ docViewPath={this.docViewPath}
PanelWidth={this.PanelWidth}
PanelHeight={this.PanelHeight}
NativeWidth={this.NativeWidth}