diff options
| author | bobzel <zzzman@gmail.com> | 2021-03-20 12:09:14 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2021-03-20 12:09:14 -0400 |
| commit | f7e9d374d2b397a395da48af412323f61538b7d9 (patch) | |
| tree | fdd8d96510b03d056b7e6accdefe8c972fd7f8ed /src/client/views/SidebarAnnos.tsx | |
| parent | 05e562534763d1c15218ef82b6cb8e8d9bba35b1 (diff) | |
cleanup of sidebars for pdf/web - toggle open/close without sizing artifacts - open automatically when adding a note.
Diffstat (limited to 'src/client/views/SidebarAnnos.tsx')
| -rw-r--r-- | src/client/views/SidebarAnnos.tsx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/client/views/SidebarAnnos.tsx b/src/client/views/SidebarAnnos.tsx index f3cc30389..2d49938a9 100644 --- a/src/client/views/SidebarAnnos.tsx +++ b/src/client/views/SidebarAnnos.tsx @@ -24,7 +24,7 @@ interface ExtraProps { annotationsActive: (outsideReaction: boolean) => boolean; whenActiveChanged: (isActive: boolean) => void; ScreenToLocalTransform: () => Transform; - addDocument: (doc: (Doc | Doc[]), suffix: string) => boolean; + sidebarAddDocument: (doc: (Doc | Doc[]), suffix: string) => boolean; removeDocument: (doc: (Doc | Doc[]), suffix: string) => boolean; moveDocument: (doc: Doc | Doc[], targetCollection: Doc | undefined, addDocument: (doc: Doc | Doc[]) => boolean, annotationKey?: string) => boolean; } @@ -39,7 +39,6 @@ export class SidebarAnnos extends React.Component<FieldViewProps & ExtraProps> { get filtersKey() { return "_" + this.sidebarKey() + "-docFilters"; } anchorMenuClick = (anchor: Doc) => { - this.props.layoutDoc._showSidebar = true; const startup = StrListCast(this.props.rootDoc.docFilters).map(filter => filter.split(":")[0]).join(" "); const target = Docs.Create.TextDocument(startup, { title: "anno", @@ -67,7 +66,7 @@ export class SidebarAnnos extends React.Component<FieldViewProps & ExtraProps> { screenToLocalTransform = () => this.props.ScreenToLocalTransform().translate(Doc.NativeWidth(this.props.dataDoc), 0).scale(this.props.scaling?.() || 1); panelWidth = () => !this.props.layoutDoc._showSidebar ? 0 : (NumCast(this.props.layoutDoc.nativeWidth) - Doc.NativeWidth(this.props.dataDoc)) * this.props.PanelWidth() / NumCast(this.props.layoutDoc.nativeWidth); panelHeight = () => this.props.PanelHeight() - this.filtersHeight() - 20; - addDocument = (doc: Doc | Doc[]) => this.props.addDocument(doc, this.sidebarKey()); + addDocument = (doc: Doc | Doc[]) => this.props.sidebarAddDocument(doc, this.sidebarKey()); moveDocument = (doc: Doc | Doc[], targetCollection: Doc | undefined, addDocument: (doc: Doc | Doc[]) => boolean) => this.props.moveDocument(doc, targetCollection, addDocument, this.sidebarKey()); removeDocument = (doc: Doc | Doc[]) => this.props.removeDocument(doc, this.sidebarKey()); docFilters = () => [...StrListCast(this.props.layoutDoc._docFilters), ...StrListCast(this.props.layoutDoc[this.filtersKey])]; @@ -80,7 +79,6 @@ export class SidebarAnnos extends React.Component<FieldViewProps & ExtraProps> { {tag} </div>; }; - console.log(this.props.dataDoc.title, this.sidebarKey(), this.props.dataDoc[this.sidebarKey()]) return !this.props.layoutDoc._showSidebar ? (null) : <div style={{ position: "absolute", pointerEvents: this.props.active() ? "all" : undefined, top: 0, right: 0, |
