diff options
| author | bobzel <zzzman@gmail.com> | 2024-05-02 11:19:37 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-05-02 11:19:37 -0400 |
| commit | 9b424c94d7a89950e9cf3f72e684bd15a61e87ae (patch) | |
| tree | 22490a9d7dcbace5c6c70d8b39c2c8b4d0fdf399 /src/client/views/collections/CollectionDockingView.tsx | |
| parent | dd08c20ec6df3fad6ecd6b16c787f10b0c23feb4 (diff) | |
another push to remove cycles by pushing things onto Doc and DocumentView
Diffstat (limited to 'src/client/views/collections/CollectionDockingView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionDockingView.tsx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index fc9e2e39b..0ee3575f3 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -2,7 +2,7 @@ import { action, IReactionDisposer, makeObservable, observable, reaction } from import { observer } from 'mobx-react'; import * as React from 'react'; import * as ReactDOM from 'react-dom/client'; -import { addStyleSheet, addStyleSheetRule, clearStyleSheetRules, DivHeight, DivWidth, incrementTitleCopy, UpdateIcon } from '../../../ClientUtils'; +import { addStyleSheet, addStyleSheetRule, clearStyleSheetRules, DivHeight, DivWidth, incrementTitleCopy, returnTrue, UpdateIcon } from '../../../ClientUtils'; import { Doc, DocListCast, Field, Opt } from '../../../fields/Doc'; import { AclAdmin, AclEdit, DocData } from '../../../fields/DocSymbols'; import { Id } from '../../../fields/FieldSymbols'; @@ -49,7 +49,8 @@ export class CollectionDockingView extends CollectionSubView() { private _reactionDisposer?: IReactionDisposer; private _lightboxReactionDisposer?: IReactionDisposer; private _containerRef = React.createRef<HTMLDivElement>(); - public _flush: UndoManager.Batch | undefined; + private _flush: UndoManager.Batch | undefined; + private _unmounting = false; private _ignoreStateChange = ''; public tabMap: Set<any> = new Set(); public get HasFullScreen() { @@ -330,6 +331,7 @@ export class CollectionDockingView extends CollectionSubView() { }; componentDidMount: () => void = async () => { + this._props.setContentViewBox?.(this); this._unmounting = false; SetPropSetterCb('title', this.titleChanged); // this overrides any previously assigned callback for the property if (this._containerRef.current) { @@ -366,7 +368,6 @@ export class CollectionDockingView extends CollectionSubView() { } }; - _unmounting = false; componentWillUnmount: () => void = () => { this._unmounting = true; try { @@ -383,6 +384,9 @@ export class CollectionDockingView extends CollectionSubView() { this._lightboxReactionDisposer?.(); }; + // ViewBoxInterface overrides + override isUnstyledView = returnTrue; + @action onResize = () => { const cur = this._containerRef.current; @@ -437,8 +441,8 @@ export class CollectionDockingView extends CollectionSubView() { } else { const tabTarget = (e.target as HTMLElement)?.parentElement?.className.includes('lm_tab') ? (e.target as HTMLElement).parentElement : (e.target as HTMLElement); const map = Array.from(this.tabMap).find(tab => tab.element[0] === tabTarget); - if (map?.DashDoc && DocumentView.getFirstDocumentView(map.DashDoc)) { - DocumentView.SelectView(DocumentView.getFirstDocumentView(map.DashDoc), false); + if (map?.DashDoc && DocumentView.getDocumentView(map.DashDoc, this.DocumentView?.())) { + DocumentView.SelectView(DocumentView.getDocumentView(map.DashDoc, this.DocumentView?.()), false); } } } |
