From 555d67a31adbe7e6d42f7f7805ba1348e6d505f6 Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 24 Jan 2023 17:05:25 -0500 Subject: stopped storing presCollection in PresBox in favor of computing it. added anchor menu option for viewing linked trail. fixed showing slected slides in presbox when link with up is used. --- src/client/views/nodes/formattedText/DashFieldView.tsx | 6 +++--- src/client/views/nodes/formattedText/FormattedTextBox.tsx | 12 +++++++++++- src/client/views/nodes/formattedText/marks_rts.ts | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src/client/views/nodes/formattedText') diff --git a/src/client/views/nodes/formattedText/DashFieldView.tsx b/src/client/views/nodes/formattedText/DashFieldView.tsx index 63347015b..39005a18b 100644 --- a/src/client/views/nodes/formattedText/DashFieldView.tsx +++ b/src/client/views/nodes/formattedText/DashFieldView.tsx @@ -287,12 +287,12 @@ export class DashFieldViewMenu extends AntimodeMenu { document.addEventListener('pointerdown', hideMenu, true); }; render() { - return this.getElement([ + return this.getElement( {`Show Pivot Viewer for '${this._fieldKey}'`}}> - , - ]); + + ); } } diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index deb1d68a7..8407eee96 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -693,6 +693,15 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent (anchor.followLinkToggle = !anchor.followLinkToggle); + @undoBatch + showTargetTrail = (anchor: Doc) => { + const trail = DocCast(anchor.presTrail); + if (trail) { + Doc.ActivePresentation = trail; + this.props.addDocTab(trail, OpenWhere.replaceRight); + } + }; + isTargetToggler = (anchor: Doc) => BoolCast(anchor.followLinkToggle); specificContextMenu = (e: React.MouseEvent): void => { @@ -717,6 +726,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent this.pinToPres(anchor as Doc); AnchorMenu.Instance.MakeTargetToggle = () => this.makeTargetToggle(anchor as Doc); + AnchorMenu.Instance.ShowTargetTrail = () => this.showTargetTrail(anchor as Doc); AnchorMenu.Instance.IsTargetToggler = () => this.isTargetToggler(anchor as Doc); AnchorMenu.Instance.jumpTo(e.clientX, e.clientY, true); }) @@ -1471,7 +1481,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent