aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/LinkDocPreview.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/LinkDocPreview.tsx')
-rw-r--r--src/client/views/nodes/LinkDocPreview.tsx22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/client/views/nodes/LinkDocPreview.tsx b/src/client/views/nodes/LinkDocPreview.tsx
index 89ea57f65..d47942bd9 100644
--- a/src/client/views/nodes/LinkDocPreview.tsx
+++ b/src/client/views/nodes/LinkDocPreview.tsx
@@ -41,7 +41,7 @@ export class LinkDocPreview extends React.Component<Props> {
async followDefault() {
DocumentLinksButton.EditLink = undefined;
LinkDocPreview.LinkInfo = undefined;
- this._targetDoc ? DocumentManager.Instance.FollowLink(this.props.linkDoc, this._targetDoc, doc => this.props.addDocTab(doc, "add:right"), false) : null;
+ this._targetDoc ? DocumentManager.Instance.FollowLink(this.props.linkDoc, this._targetDoc, (doc, where) => this.props.addDocTab(doc, where), false) : null;
}
componentWillUnmount() { LinkDocPreview.TargetDoc = undefined; }
@@ -64,7 +64,7 @@ export class LinkDocPreview extends React.Component<Props> {
this._toolTipText = "";
LinkDocPreview.TargetDoc = this._targetDoc = target;
if (anchor !== this._targetDoc && anchor && this._targetDoc) {
- this._targetDoc._scrollY = NumCast(anchor?.y);
+ this._targetDoc._scrollPreviewY = NumCast(anchor?.y);
}
});
}
@@ -77,19 +77,16 @@ export class LinkDocPreview extends React.Component<Props> {
this.props.addDocTab(Docs.Create.WebDocument(this.props.href, { _fitWidth: true, title: this.props.href, _width: 200, _height: 400, useCors: true }), "add:right");
}
}
- width = () => Math.min(225, NumCast(this._targetDoc?.[WidthSym](), 225)) - 16;
- height = () => Math.min(225, NumCast(this._targetDoc?.[HeightSym](), 225)) - 16;
+ width = () => Math.min(225, NumCast(this._targetDoc?.[WidthSym](), 225));
+ height = () => Math.min(225, NumCast(this._targetDoc?.[HeightSym](), 225));
@computed get targetDocView() {
return !this._targetDoc ?
- <div style={{
- pointerEvents: "all", maxWidth: 225, maxHeight: 225, width: "100%", height: "100%",
- overflow: "hidden"
- }}>
+ <div style={{ pointerEvents: "all", maxWidth: 225, maxHeight: 225, width: "100%", height: "100%", overflow: "hidden" }}>
<div style={{ width: "100%", height: "100%", textOverflow: "ellipsis", }} onPointerDown={this.pointerDown}>
{this._toolTipText}
</div>
- </div> :
-
+ </div>
+ :
<ContentFittingDocumentView
Document={this._targetDoc}
LibraryPath={emptyPath}
@@ -104,12 +101,13 @@ export class LinkDocPreview extends React.Component<Props> {
pinToPres={returnFalse}
dontRegisterView={true}
docFilters={returnEmptyFilter}
+ docRangeFilters={returnEmptyFilter}
searchFilterDocs={returnEmptyDoclist}
ContainingCollectionDoc={undefined}
ContainingCollectionView={undefined}
renderDepth={-1}
- PanelWidth={this.width} //Math.min(350, NumCast(target._width, 350))}
- PanelHeight={this.height} //Math.min(250, NumCast(target._height, 250))}
+ PanelWidth={this.width}
+ PanelHeight={this.height}
focus={emptyFunction}
whenActiveChanged={returnFalse}
bringToFront={returnFalse}