diff options
| author | monikahedman <monika_hedman@brown.edu> | 2019-08-27 13:19:20 -0400 |
|---|---|---|
| committer | monikahedman <monika_hedman@brown.edu> | 2019-08-27 13:19:20 -0400 |
| commit | b4f79e48d5d30312367e268c2c505f65c5cacdb4 (patch) | |
| tree | 5d5905d59860b0528ad8c3a5d6b4e49b95e4e860 /src/client/views/linking/LinkFollowBox.tsx | |
| parent | ac4a5af7ec796c914509a696db0dbc749e0c40d3 (diff) | |
things are progressing
Diffstat (limited to 'src/client/views/linking/LinkFollowBox.tsx')
| -rw-r--r-- | src/client/views/linking/LinkFollowBox.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/views/linking/LinkFollowBox.tsx b/src/client/views/linking/LinkFollowBox.tsx index 213022bc8..cf44ae649 100644 --- a/src/client/views/linking/LinkFollowBox.tsx +++ b/src/client/views/linking/LinkFollowBox.tsx @@ -16,6 +16,7 @@ import { Id } from "../../../new_fields/FieldSymbols"; import { listSpec } from "../../../new_fields/Schema"; import { DocServer } from "../../DocServer"; import { RefField } from "../../../new_fields/RefField"; +import { Docs } from "../../documents/Documents"; enum FollowModes { OPENTAB = "Open in Tab", @@ -59,6 +60,11 @@ export class LinkFollowBox extends React.Component<FieldViewProps> { this.collectionTypes = ["Invalid", "Freeform", "Schema", "Docking", "Tree", "Stacking", "Masonry"]; } + @computed + get getDoc() { + return this.props.Document; + } + componentDidMount = () => { this.resetVars(); @@ -322,6 +328,10 @@ export class LinkFollowBox extends React.Component<FieldViewProps> { currentLinkBehavior = () => { // this.resetPan(); if (LinkFollowBox.destinationDoc) { + if (this.selectedContextString === "") { + this.selectedContextString = "self"; + this.selectedContext = LinkFollowBox.destinationDoc; + } if (this.selectedOption === "") this.selectedOption = FollowOptions.NOZOOM; let shouldZoom: boolean = this.selectedOption === FollowOptions.NOZOOM ? false : true; let notOpenInContext: boolean = this.selectedContextString === "self" || this.selectedContextString === LinkFollowBox.destinationDoc[Id]; @@ -476,7 +486,7 @@ export class LinkFollowBox extends React.Component<FieldViewProps> { type="radio" disabled={LinkFollowBox.linkDoc ? false : true} name="context" value={LinkFollowBox.destinationDoc ? StrCast(LinkFollowBox.destinationDoc[Id]) : "self"} - checked={LinkFollowBox.destinationDoc ? this.selectedContextString === StrCast(LinkFollowBox.destinationDoc[Id]) : this.selectedContextString === "self"} + checked={LinkFollowBox.destinationDoc ? this.selectedContextString === StrCast(LinkFollowBox.destinationDoc[Id]) || this.selectedContextString === "self" : true} onChange={this.handleContextChange} /> Open Self </label><br /> |
