aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/linking/LinkMenuItem.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-10-10 12:12:14 -0400
committerbobzel <zzzman@gmail.com>2023-10-10 12:12:14 -0400
commit9f4c6d895eb6ff495a99463e8150c5d1dff26c5b (patch)
tree161d543d60ae4360bd1133cdad5283af8ab4b094 /src/client/views/linking/LinkMenuItem.tsx
parent3884211ab83db30965a4dc1c4b3133684904ebb9 (diff)
parentc9d83841221620137e89920198ffaeab2677b439 (diff)
merged with master
Diffstat (limited to 'src/client/views/linking/LinkMenuItem.tsx')
-rw-r--r--src/client/views/linking/LinkMenuItem.tsx17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx
index 9bc8f5e8b..bf2a4e1a9 100644
--- a/src/client/views/linking/LinkMenuItem.tsx
+++ b/src/client/views/linking/LinkMenuItem.tsx
@@ -69,10 +69,8 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> {
}
return this.props.sourceDoc;
}
- @action
+
onEdit = (e: React.PointerEvent) => {
- LinkManager.currentLink = this.props.linkDoc === LinkManager.currentLink ? undefined : this.props.linkDoc;
- LinkManager.currentLinkAnchor = this.sourceAnchor;
setupMoveUpEvents(
this,
e,
@@ -90,8 +88,11 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> {
DocumentViewInternal.addDocTabFunc(trail, OpenWhere.replaceRight);
} else {
SelectionManager.SelectView(this.props.docView, false);
+ LinkManager.currentLink = this.props.linkDoc === LinkManager.currentLink ? undefined : this.props.linkDoc;
+ LinkManager.currentLinkAnchor = LinkManager.currentLink ? this.sourceAnchor : undefined;
+
if ((SettingsManager.propertiesWidth ?? 0) < 100) {
- SettingsManager.propertiesWidth = 250;
+ setTimeout(action(() => (SettingsManager.propertiesWidth = 250)));
}
}
})
@@ -150,7 +151,11 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> {
className="linkMenu-item"
onPointerEnter={action(e => (this._hover = true))}
onPointerLeave={action(e => (this._hover = false))}
- style={{ background: /*LinkManager.currentLink !== this.props.linkDoc*/ this._hover ? SettingsManager.userVariantColor : SettingsManager.userBackgroundColor }}>
+ style={{
+ fontSize: this._hover ? 'larger' : undefined,
+ fontWeight: this._hover ? 'bold' : undefined,
+ background: LinkManager.currentLink === this.props.linkDoc ? SettingsManager.userVariantColor : SettingsManager.userBackgroundColor,
+ }}>
<div className="linkMenu-item-content expand-two">
<div
ref={this._drag}
@@ -192,7 +197,7 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> {
{this.props.linkDoc.linksToAnnotation && Cast(this.props.destinationDoc.data, WebField)?.url.href === this.props.linkDoc.annotationUri ? 'Annotation in' : ''} {StrCast(title)}
</p>
</div>
- {!this.props.linkDoc.link_description ? null : <p className="linkMenu-description">{StrCast(this.props.linkDoc.link_description)}</p>}
+ {!this.props.linkDoc.link_description ? null : <p className="linkMenu-description">{StrCast(this.props.linkDoc.link_description).split('\n')[0].substring(0, 50)}</p>}
</div>
<div className="linkMenu-item-buttons">