diff options
author | Lauren Choi <laurenchoi@gmail.com> | 2021-10-30 15:30:31 -0400 |
---|---|---|
committer | Lauren Choi <laurenchoi@gmail.com> | 2021-10-30 15:30:31 -0400 |
commit | d20c02b245148524f3d6f4fd4dc2dff7a3039b06 (patch) | |
tree | edeb54a2cd88aea769353f045da0711440cd1057 /src | |
parent | 54bdf1a1549e57d6d28ae977706b601384fdc3c4 (diff) |
change follow behavior
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/PropertiesView.tsx | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index 69224312a..13018b268 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -1087,8 +1087,6 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { @observable description = Field.toString(LinkManager.currentLink?.description as any as Field); - @observable - follow = Field.toString(LinkManager.currentLink?.follow as any as Field); @action handleDescriptionChange = (e: React.ChangeEvent<HTMLInputElement>) => { this.description = e.target.value; } @@ -1109,6 +1107,12 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { } }); + getCurrentFollow = () => { + if (LinkManager.currentLink) { + return StrCast(Doc.GetProto(LinkManager.currentLink).followLinkLocation); + } + } + onSelectOut = () => { this.setDescripValue(this.description); document.getElementById('input')?.blur(); @@ -1180,15 +1184,13 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { <p className="propertiesView-label">Behavior</p> <div className="propertiesView-input inline first" id="propertiesView-follow"> <p>Follow</p> - <select name="selectList" id="selectList"> - <option value="default" onPointerDown={() => { - this.changeFollowBehavior("default") - console.log("default") - }}>Default</option> - <option value="newLeft" onPointerDown={() => { - this.changeFollowBehavior("newLeft") - console.log("newLeft") - }}>Open in new left pane</option> + <select + name="selectList" + id="selectList" + onChange={e => this.changeFollowBehavior(e.currentTarget.value)} + value={this.getCurrentFollow()}> + <option value="default">Default</option> + <option value="newLeft">Open in new left pane</option> <option value="newRight">Open in new right pane</option> <option value="replaceLeft">Replace left tab</option> <option value="replaceRight">Replace right tab</option> |