diff options
| author | bobzel <zzzman@gmail.com> | 2021-03-22 14:55:45 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2021-03-22 14:55:45 -0400 |
| commit | d8445ef3b2402530b5139b94eeb0f333c1fed661 (patch) | |
| tree | 3eca8b61462fb4b60e020329c932bf516c256886 /src/client/views/SidebarAnnos.tsx | |
| parent | 3c8325a99c4cec82148039d381df8377dcd4ee3a (diff) | |
adjusted playLink in videos to start 1/4 sec early to trigger following link to anchor. changed text sidebars to show titles. fixed title autoHeight computations in formattedTextBox. fixed styleprovider to compute headerMargin correctly by inquiring style for ShowTitle.
Diffstat (limited to 'src/client/views/SidebarAnnos.tsx')
| -rw-r--r-- | src/client/views/SidebarAnnos.tsx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/views/SidebarAnnos.tsx b/src/client/views/SidebarAnnos.tsx index 2d49938a9..9d085e2b6 100644 --- a/src/client/views/SidebarAnnos.tsx +++ b/src/client/views/SidebarAnnos.tsx @@ -1,6 +1,6 @@ import { computed } from 'mobx'; import { observer } from "mobx-react"; -import { Doc, DocListCast, StrListCast } from "../../fields/Doc"; +import { Doc, DocListCast, StrListCast, Opt } from "../../fields/Doc"; import { Id } from '../../fields/FieldSymbols'; import { List } from '../../fields/List'; import { NumCast, StrCast } from '../../fields/Types'; @@ -15,6 +15,7 @@ import { SearchBox } from './search/SearchBox'; import "./SidebarAnnos.scss"; import { StyleProp } from './StyleProvider'; import React = require("react"); +import { DocumentViewProps } from './nodes/DocumentView'; interface ExtraProps { fieldKey: string; @@ -71,6 +72,10 @@ export class SidebarAnnos extends React.Component<FieldViewProps & ExtraProps> { removeDocument = (doc: Doc | Doc[]) => this.props.removeDocument(doc, this.sidebarKey()); docFilters = () => [...StrListCast(this.props.layoutDoc._docFilters), ...StrListCast(this.props.layoutDoc[this.filtersKey])]; + sidebarStyleProvider = (doc: Opt<Doc>, props: Opt<FieldViewProps | DocumentViewProps>, property: string) => { + if (property === StyleProp.ShowTitle) return "title"; + return this.props.styleProvider?.(doc, props, property) + } render() { const renderTag = (tag: string) => { const active = StrListCast(this.props.rootDoc[this.filtersKey]).includes(`${tag}:${tag}:check`); @@ -94,6 +99,7 @@ export class SidebarAnnos extends React.Component<FieldViewProps & ExtraProps> { PanelWidth={this.panelWidth} xMargin={0} yMargin={0} + styleProvider={this.sidebarStyleProvider} docFilters={this.docFilters} scaleField={this.sidebarKey() + "-scale"} isAnnotationOverlay={false} |
