aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/linking/LinkMenuItem.tsx
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-10-10 16:21:41 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-10-10 16:21:41 -0400
commit9e91e6065333f03d3f3bf2c0d43b822d85344c78 (patch)
tree4c923fc8257b597d69700bee4c1a4e69d3cbe21a /src/client/views/linking/LinkMenuItem.tsx
parent368e33c076085b1b73f522ac88f548a2ad081c80 (diff)
parentd929c0511cae863412a398f426d9e5b7ca64e6d9 (diff)
merge?
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">