aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/SidebarAnnos.tsx
diff options
context:
space:
mode:
authorNaafiyan Ahmed <naafiyan@gmail.com>2022-08-10 17:12:58 -0400
committerNaafiyan Ahmed <naafiyan@gmail.com>2022-08-10 17:12:58 -0400
commit9dae453967183b294bf4f7444b948023a1d52d39 (patch)
tree986f4a79b8c5b92013a70b5ecba704bbba4a7ff8 /src/client/views/SidebarAnnos.tsx
parentc80d0763c87d1965f451bbd7b31d8da8228dc048 (diff)
parent513dcaa2d8c86f1cb5236ce89062cace6f418d1b (diff)
Merge branch 'master' into data-visualization-view-naafi
Diffstat (limited to 'src/client/views/SidebarAnnos.tsx')
-rw-r--r--src/client/views/SidebarAnnos.tsx13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/views/SidebarAnnos.tsx b/src/client/views/SidebarAnnos.tsx
index e81a9c40f..90d9c3c43 100644
--- a/src/client/views/SidebarAnnos.tsx
+++ b/src/client/views/SidebarAnnos.tsx
@@ -74,6 +74,7 @@ export class SidebarAnnos extends React.Component<FieldViewProps & ExtraProps> {
DocUtils.MakeLink({ doc: anchor }, { doc: target }, 'inline comment:comment on');
this.addDocument(target);
this._stackRef.current?.focusDocument(target);
+ return target;
};
makeDocUnfiltered = (doc: Doc) => {
if (DocListCast(this.props.rootDoc[this.sidebarKey]).includes(doc)) {
@@ -93,7 +94,7 @@ export class SidebarAnnos extends React.Component<FieldViewProps & ExtraProps> {
this.props
.ScreenToLocalTransform()
.translate(Doc.NativeWidth(this.props.dataDoc), 0)
- .scale(this.props.scaling?.() || 1);
+ .scale(this.props.NativeDimScaling?.() || 1);
// panelWidth = () => !this.props.layoutDoc._showSidebar ? 0 :
// this.props.usePanelWidth ? this.props.PanelWidth() :
// (NumCast(this.props.layoutDoc.nativeWidth) - Doc.NativeWidth(this.props.dataDoc)) * this.props.PanelWidth() / NumCast(this.props.layoutDoc.nativeWidth);
@@ -101,7 +102,7 @@ export class SidebarAnnos extends React.Component<FieldViewProps & ExtraProps> {
!this.props.showSidebar
? 0
: this.props.layoutDoc.type === DocumentType.RTF || this.props.layoutDoc.type === DocumentType.MAP
- ? this.props.PanelWidth()
+ ? this.props.PanelWidth() / (this.props.NativeDimScaling?.() || 1)
: ((NumCast(this.props.nativeWidth) - Doc.NativeWidth(this.props.dataDoc)) * this.props.PanelWidth()) / NumCast(this.props.nativeWidth);
panelHeight = () => this.props.PanelHeight() - this.filtersHeight();
addDocument = (doc: Doc | Doc[]) => this.props.sidebarAddDocument(doc, this.sidebarKey);
@@ -144,14 +145,14 @@ export class SidebarAnnos extends React.Component<FieldViewProps & ExtraProps> {
top: this.props.rootDoc.type !== DocumentType.RTF && StrCast(this.props.rootDoc._showTitle) === 'title' ? 15 : 0,
right: 0,
background: this.props.styleProvider?.(this.props.rootDoc, this.props, StyleProp.WidgetColor),
- width: `${this.panelWidth()}px`,
+ width: `100%`,
height: '100%',
}}>
- <div className="sidebarAnnos-tagList" style={{ height: this.filtersHeight(), width: this.panelWidth() }} onWheel={e => e.stopPropagation()}>
+ <div className="sidebarAnnos-tagList" style={{ height: this.filtersHeight() }} onWheel={e => e.stopPropagation()}>
{this.allUsers.map(renderUsers)}
{this.allMetadata.map(renderMeta)}
</div>
- <div style={{ width: '100%', height: this.panelHeight(), position: 'relative' }}>
+ <div style={{ width: '100%', height: `calc(100% - 38px)`, position: 'relative' }}>
<CollectionStackingView
{...OmitKeys(this.props, ['NativeWidth', 'NativeHeight', 'setContentView']).omit}
ref={this._stackRef}
@@ -164,7 +165,7 @@ export class SidebarAnnos extends React.Component<FieldViewProps & ExtraProps> {
setHeight={this.setHeightCallback}
isAnnotationOverlay={false}
select={emptyFunction}
- scaling={returnOne}
+ NativeDimScaling={returnOne}
childShowTitle={this.showTitle}
childDocumentsActive={this.props.isContentActive}
whenChildContentsActiveChanged={this.props.whenChildContentsActiveChanged}