From 67435353b39071fbe3295cc80e35ee3df952f082 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 19 Nov 2020 10:11:29 -0500 Subject: made inkingStroke honor _isBackground. prevented link anchor dots from moving when target isn't visible. made ui option for showing/hiding link lines and for autoMoving anchor dots. --- src/client/views/linking/LinkMenuItem.tsx | 34 +++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'src/client/views/linking/LinkMenuItem.tsx') diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx index 5c9123876..b9e240ba2 100644 --- a/src/client/views/linking/LinkMenuItem.tsx +++ b/src/client/views/linking/LinkMenuItem.tsx @@ -174,14 +174,26 @@ export class LinkMenuItem extends React.Component { @undoBatch @action - showLink = () => { - this.props.linkDoc.hidden = !this.props.linkDoc.hidden; + autoMove = (e: React.PointerEvent) => { + e.stopPropagation(); + this.props.linkDoc.linkAutoMove = !this.props.linkDoc.linkAutoMove; } - render() { + @undoBatch + @action + showLink = (e: React.PointerEvent) => { + e.stopPropagation(); + this.props.linkDoc.linkDisplay = !this.props.linkDoc.linkDisplay; + } - const eyeIcon = this.props.linkDoc.hidden ? "eye-slash" : "eye"; + @undoBatch + @action + showAnchor = (e: React.PointerEvent) => { + e.stopPropagation(); + this.props.linkDoc.hidden = !this.props.linkDoc.hidden; + } + render() { let destinationIcon: FontAwesomeIconProps["icon"] = "question"; switch (this.props.destinationDoc.type) { case DocumentType.IMG: destinationIcon = "image"; break; @@ -243,9 +255,19 @@ export class LinkMenuItem extends React.Component {
-
{this.props.linkDoc.hidden ? "Show link" : "Hide link"}
}> +
{this.props.linkDoc.hidden ? "Show Anchor" : "Hide Anchor"}
}> +
+
+
+ +
{!this.props.linkDoc.linkDisplay ? "Show link" : "Hide link"}
}>
-
+
+ + +
{!this.props.linkDoc.linkAutoMove ? "Auto move dot" : "Freeze dot position"}
}> +
+
Edit Link
}> -- cgit v1.2.3-70-g09d2