diff options
author | Melissa Zhang <mzhang19096@gmail.com> | 2020-07-14 22:22:47 -0700 |
---|---|---|
committer | Melissa Zhang <mzhang19096@gmail.com> | 2020-07-14 22:22:47 -0700 |
commit | 610ddaf1425018b4b00eb1fae83930f20777bad7 (patch) | |
tree | 102c20334b54e2200030f7d36ce11cd7b8987a43 /src/client/views/linking/LinkMenuItem.tsx | |
parent | eb6e1b6705560d6fe94cb5787839b9138ab4b979 (diff) |
deleting a link in a document removes its corresponding hyperlink in annotation (with some regex bugs)
Diffstat (limited to 'src/client/views/linking/LinkMenuItem.tsx')
-rw-r--r-- | src/client/views/linking/LinkMenuItem.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx index ad3c12122..509de2745 100644 --- a/src/client/views/linking/LinkMenuItem.tsx +++ b/src/client/views/linking/LinkMenuItem.tsx @@ -11,11 +11,13 @@ import { ContextMenu } from '../ContextMenu'; import './LinkMenuItem.scss'; import React = require("react"); import { DocumentManager } from '../../util/DocumentManager'; -import { setupMoveUpEvents, emptyFunction } from '../../../Utils'; +import { setupMoveUpEvents, emptyFunction, Utils } from '../../../Utils'; import { DocumentView } from '../nodes/DocumentView'; import { DocumentLinksButton } from '../nodes/DocumentLinksButton'; import { LinkDocPreview } from '../nodes/LinkDocPreview'; import { WebField } from '../../../fields/URLField'; +import { Hypothesis } from '../../apis/hypothesis/HypothesisApiUtils'; +import { Id } from '../../../fields/FieldSymbols'; library.add(faEye, faEdit, faTimes, faArrowRight, faChevronDown, faChevronUp, faPencilAlt); @@ -169,6 +171,8 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> { @action deleteLink = (): void => { + this.props.linkDoc.linksToAnnotation && Hypothesis.deleteLink(StrCast(this.props.linkDoc.annotationId), Utils.prepend("/doc/" + this.props.sourceDoc[Id])); // delete hyperlink in annotation + this.props.linkDoc.linksToAnnotation && console.log("annotationId", this.props.linkDoc.annotationId); LinkManager.Instance.deleteLink(this.props.linkDoc); //this.props.showLinks(); LinkDocPreview.LinkInfo = undefined; |