diff options
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> |