From 8c9e41ce30e37e55265a4ea8c52cd0567af227e4 Mon Sep 17 00:00:00 2001 From: Melissa Zhang Date: Wed, 5 Aug 2020 15:50:13 -0700 Subject: small bug fixes --- src/client/views/collections/CollectionLinearView.tsx | 2 +- src/client/views/collections/CollectionSubView.tsx | 8 +++++++- src/client/views/nodes/DocumentLinksButton.tsx | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionLinearView.tsx b/src/client/views/collections/CollectionLinearView.tsx index 19d1ffa7b..3cf46dbed 100644 --- a/src/client/views/collections/CollectionLinearView.tsx +++ b/src/client/views/collections/CollectionLinearView.tsx @@ -176,7 +176,7 @@ export class CollectionLinearView extends CollectionSubView(LinearDocument) { }} onPointerDown={e => e.stopPropagation()} > - Creating link from: {DocumentLinksButton.AnnotationId ? "Annotation in" : ""} {DocumentLinksButton.StartLink.title} + Creating link from: {DocumentLinksButton.AnnotationId ? "Annotation in " : " "} {StrCast(DocumentLinksButton.StartLink.title).length < 51 ? DocumentLinksButton.StartLink.title : StrCast(DocumentLinksButton.StartLink.title).slice(0, 50) + '...'}
{LinkDescriptionPopup.showDescriptions ? "Turn off description pop-up" : diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx index 2c382fe88..ce3654cf2 100644 --- a/src/client/views/collections/CollectionSubView.tsx +++ b/src/client/views/collections/CollectionSubView.tsx @@ -349,7 +349,13 @@ export function CollectionSubView(schemaCtor: (doc: Doc) => T, moreProps?: const existingWebDoc = await Hypothesis.findWebDoc(uriList); if (existingWebDoc) { - this.addDocument(Doc.MakeAlias(existingWebDoc)); + const alias = Doc.MakeAlias(existingWebDoc); + alias.x = options.x; + alias.y = options.y; + alias._nativeWidth = 850; + alias._nativeHeight = 962; + alias._width = 400; + this.addDocument(alias); } else { const cleanedUri = uriList.split("#annotations:")[0]; // clean hypothes.is URLs that reference a specific annotation (eg. https://en.wikipedia.org/wiki/Cartoon#annotations:t7qAeNbCEeqfG5972KR2Ig) this.addDocument(Docs.Create.WebDocument(uriList, { diff --git a/src/client/views/nodes/DocumentLinksButton.tsx b/src/client/views/nodes/DocumentLinksButton.tsx index dcdaa3199..3057d87e8 100644 --- a/src/client/views/nodes/DocumentLinksButton.tsx +++ b/src/client/views/nodes/DocumentLinksButton.tsx @@ -92,6 +92,8 @@ export class DocumentLinksButton extends React.Component { if (this.props.InMenu && this.props.StartLink) { + DocumentLinksButton.AnnotationId = undefined; + DocumentLinksButton.AnnotationUri = undefined; if (DocumentLinksButton.StartLink === this.props.View.props.Document) { DocumentLinksButton.StartLink = undefined; } else { @@ -152,6 +154,7 @@ export class DocumentLinksButton extends React.Component