diff options
Diffstat (limited to 'src/client/views/PropertiesView.tsx')
-rw-r--r-- | src/client/views/PropertiesView.tsx | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index bba2ac211..bcfd2dd56 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -1227,6 +1227,13 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { setupMoveUpEvents(this, e, returnFalse, emptyFunction, undoBatch(action(() => this.selectedDoc.displayArrow = !this.selectedDoc.displayArrow))); } + toggleZoomToTarget1 = (e: React.PointerEvent) => { + setupMoveUpEvents(this, e, returnFalse, emptyFunction, undoBatch(action(() => Cast(this.selectedDoc.anchor1, Doc, null).followLinkZoom = !Cast(this.selectedDoc.anchor1, Doc, null).followLinkZoom))); + } + toggleZoomToTarget2 = (e: React.PointerEvent) => { + setupMoveUpEvents(this, e, returnFalse, emptyFunction, undoBatch(action(() => Cast(this.selectedDoc.anchor2, Doc, null).followLinkZoom = !Cast(this.selectedDoc.anchor2, Doc, null).followLinkZoom))); + } + @computed get editRelationship() { return <input @@ -1283,18 +1290,18 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { </div> <div className="propertiesView-section"> <p className="propertiesView-label">Information</p> - <div className="propertiesView-input first" id="propertiesView-category"> + <div className="propertiesView-input first"> <p>Link Relationship</p> {this.editRelationship} </div> - <div className="propertiesView-input" id="propertiesView-description"> + <div className="propertiesView-input"> <p>Description</p> {this.editDescription} </div> </div> <div className="propertiesView-section"> <p className="propertiesView-label">Behavior</p> - <div className="propertiesView-input inline first" id="propertiesView-follow"> + <div className="propertiesView-input inline first"> <p>Follow</p> <select name="selectList" @@ -1314,7 +1321,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { : null} </select> </div> - <div className="propertiesView-input inline" id="propertiesView-anchor"> + <div className="propertiesView-input inline"> <p>Auto-move anchor</p> <button style={{ background: this.selectedDoc.hidden ? "gray" : !this.selectedDoc.linkAutoMove ? "" : "#4476f7", borderRadius: 3 }} @@ -1324,7 +1331,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { <FontAwesomeIcon className="fa-icon" icon={faAnchor as IconLookup} size="lg" /> </button> </div> - <div className="propertiesView-input inline" id="propertiesView-displayArrow"> + <div className="propertiesView-input inline"> <p>Display arrow</p> <button style={{ background: this.selectedDoc.hidden ? "gray" : !this.selectedDoc.displayArrow ? "" : "#4476f7", borderRadius: 3 }} @@ -1334,6 +1341,26 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { <FontAwesomeIcon className="fa-icon" icon={faArrowRight as IconLookup} size="lg" /> </button> </div> + <div className="propertiesView-input inline"> + <p>Zoom to target</p> + <button + style={{ background: this.selectedDoc.hidden ? "gray" : !Cast(this.selectedDoc.anchor1, Doc, null).followLinkZoom ? "" : "#4476f7", borderRadius: 3 }} + onPointerDown={this.toggleZoomToTarget1} onClick={e => e.stopPropagation()} + className="propertiesButton" + > + <FontAwesomeIcon className="fa-icon" icon={faArrowRight as IconLookup} size="lg" /> + </button> + </div> + <div className="propertiesView-input inline"> + <p>Zoom to source</p> + <button + style={{ background: this.selectedDoc.hidden ? "gray" : !Cast(this.selectedDoc.anchor2, Doc, null).followLinkZoom ? "" : "#4476f7", borderRadius: 3 }} + onPointerDown={this.toggleZoomToTarget2} onClick={e => e.stopPropagation()} + className="propertiesButton" + > + <FontAwesomeIcon className="fa-icon" icon={faArrowRight as IconLookup} size="lg" /> + </button> + </div> </div> </div >; } |