aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/AnchorMenu.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/pdf/AnchorMenu.tsx')
-rw-r--r--src/client/views/pdf/AnchorMenu.tsx12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/client/views/pdf/AnchorMenu.tsx b/src/client/views/pdf/AnchorMenu.tsx
index d098791e5..8d74b2ac4 100644
--- a/src/client/views/pdf/AnchorMenu.tsx
+++ b/src/client/views/pdf/AnchorMenu.tsx
@@ -45,8 +45,9 @@ export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> {
@observable public Highlighting: boolean = false;
@observable public Status: "marquee" | "annotation" | "" = "";
+ public onMakeAnchor: () => Opt<Doc> = () => undefined; // Method to get anchor from text search
+
public OnClick: (e: PointerEvent) => void = unimplementedFunction;
- public OnLink: (e: PointerEvent) => void = unimplementedFunction;
public StartDrag: (e: PointerEvent, ele: HTMLElement) => void = unimplementedFunction;
public Highlight: (color: string, isPushpin: boolean) => Opt<Doc> = (color: string, isPushpin: boolean) => undefined;
public GetAnchor: (savedAnnotations?: ObservableMap<number, HTMLDivElement[]>) => Opt<Doc> = () => undefined;
@@ -67,15 +68,12 @@ export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> {
componentDidMount() {
this._disposer = reaction(() => SelectionManager.Views(),
selected => {
- AnchorMenu.Instance.fadeOut(true)
this._showLinkPopup = false;
+ console.log("unmount");
+ AnchorMenu.Instance.fadeOut(true)
});
}
- componentWillUnmount() {
- console.log("unmount");
- }
-
pointerDown = (e: React.PointerEvent) => {
setupMoveUpEvents(this, e, (e: PointerEvent) => {
this.StartDrag(e, this._commentCont.current!);
@@ -159,7 +157,7 @@ export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> {
<FontAwesomeIcon icon="link" size="lg" />
</button>
</Tooltip>,
- <LinkPopup showPopup={this._showLinkPopup}/>
+ <LinkPopup showPopup={this._showLinkPopup} linkFrom={this.onMakeAnchor}/>
] : [
<Tooltip key="trash" title={<div className="dash-tooltip">{"Remove Link Anchor"}</div>}>
<button className="antimodeMenu-button" onPointerDown={this.Delete}>