aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLauren Choi <laurenchoi@gmail.com>2021-11-04 16:36:30 -0400
committerLauren Choi <laurenchoi@gmail.com>2021-11-04 16:36:30 -0400
commit6d789877e2bec0812060fce9cfded2780d2e772b (patch)
tree5e952840b054870b362673cc963285b8bd26c5d4 /src
parentacbd47f286ffe05fb025151990c3128bee8e5d20 (diff)
link relationships working
Diffstat (limited to 'src')
-rw-r--r--src/client/views/PropertiesView.tsx24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index dd6e0e3e7..2d461f7ef 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -1077,13 +1077,9 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
</div>;
}
- @observable
- description = Field.toString(LinkManager.currentLink?.description as any as Field);
- // @observable
- // linkRelationship = Field.toString(LinkManager.currentLink?.linkRelationship as any as Field);
+ @observable description = Field.toString(LinkManager.currentLink?.description as any as Field);
@observable relationship = StrCast(LinkManager.currentLink?.linkRelationship);
- @observable
- private relationshipButtonColor: string = "";
+ @observable private relationshipButtonColor: string = "";
// @action
// handleDescriptionChange = (e: React.ChangeEvent<HTMLInputElement>) => { this.description = e.target.value; }
@@ -1092,9 +1088,8 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
@undoBatch
handleDescriptionChange = action((value: string) => {
if (LinkManager.currentLink) {
- // this.description = value;
- console.log("changing description to " + value)
this.selectedDoc.description = value;
+ this.description = value;
return true;
}
});
@@ -1102,9 +1097,8 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
@undoBatch
handleLinkRelationshipChange = action((value: string) => {
if (LinkManager.currentLink) {
- // this.relationship = value;
- console.log("changing linkRelationship to " + value)
- this.selectedDoc.relationship = value;
+ this.selectedDoc.linkRelationship = value;
+ this.relationship = value;
return true;
}
});
@@ -1113,9 +1107,6 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
setDescripValue = action((value: string) => {
if (LinkManager.currentLink) {
Doc.GetProto(LinkManager.currentLink).description = value;
- console.log("the link description was set to " + Doc.GetProto(LinkManager.currentLink).description)
- // this.selectedDoc.description = value;
- // this.description = value;
return true;
}
});
@@ -1155,9 +1146,6 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
}
this.relationshipButtonColor = "rgb(62, 133, 55)";
- console.log("the linkRelationship was set to " + Doc.GetProto(LinkManager.currentLink).linkRelationship)
- // this.selectedDoc.relationship = value;
- // this.relationship = value;
setTimeout(action(() => this.relationshipButtonColor = ""), 750);
return true;
}
@@ -1204,7 +1192,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
return <input
autoComplete={"off"}
id="link_relationship_input"
- value={StrCast(this.selectedDoc.relationship)}
+ value={StrCast(this.selectedDoc.linkRelationship)}
onKeyDown={this.onRelationshipKey}
onBlur={this.onSelectOutRelationship}
onChange={e => this.handleLinkRelationshipChange(e.currentTarget.value)}