diff options
| author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-05-09 00:02:30 -0400 |
|---|---|---|
| committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-05-09 00:02:30 -0400 |
| commit | 2f5f13946cf0a1ec87efddbfbbc6a9fd878da924 (patch) | |
| tree | ea9ec90561f73ed1c977e0538699c5f53b3c4712 /src/client/views/collections/TabDocView.tsx | |
| parent | 0766ba00727e9e13ced2e16cfb049d49711fa738 (diff) | |
| parent | fa4d377b53c9ca31d8900d9c11bd25be57025962 (diff) | |
Merge branch 'nathan-starter' of https://github.com/brown-dash/Dash-Web into nathan-starter
Diffstat (limited to 'src/client/views/collections/TabDocView.tsx')
| -rw-r--r-- | src/client/views/collections/TabDocView.tsx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx index 008ef6ab4..afd584154 100644 --- a/src/client/views/collections/TabDocView.tsx +++ b/src/client/views/collections/TabDocView.tsx @@ -9,7 +9,7 @@ import * as ReactDOM from 'react-dom/client'; import { ClientUtils, DashColor, lightOrDark, returnEmptyDoclist, returnFalse, returnTrue, setupMoveUpEvents, simulateMouseClick } from '../../../ClientUtils'; import { emptyFunction } from '../../../Utils'; import { Doc, Opt } from '../../../fields/Doc'; -import { DocData, DocViews } from '../../../fields/DocSymbols'; +import { DocData } from '../../../fields/DocSymbols'; import { Id } from '../../../fields/FieldSymbols'; import { List } from '../../../fields/List'; import { FieldId } from '../../../fields/RefField'; @@ -28,13 +28,14 @@ import { LightboxView } from '../LightboxView'; import { ObservableReactComponent } from '../ObservableReactComponent'; import { PinDocView, PinProps } from '../PinFuncs'; import { StyleProp } from '../StyleProp'; -import { DefaultStyleProvider } from '../StyleProvider'; +import { DefaultStyleProvider, returnEmptyDocViewList } from '../StyleProvider'; import { Colors } from '../global/globalEnums'; -import { DocumentView, returnEmptyDocViewList } from '../nodes/DocumentView'; +import { DocumentView } from '../nodes/DocumentView'; import { FieldViewProps } from '../nodes/FieldView'; import { KeyValueBox } from '../nodes/KeyValueBox'; import { OpenWhere, OpenWhereMod } from '../nodes/OpenWhere'; -import { PresBox, PresMovement } from '../nodes/trails'; +import { PresBox } from '../nodes/trails'; +import { PresMovement } from '../nodes/trails/PresEnums'; import { CollectionDockingView } from './CollectionDockingView'; import { CollectionView } from './CollectionView'; import './TabDocView.scss'; @@ -187,6 +188,11 @@ interface TabDocViewProps { @observer export class TabDocView extends ObservableReactComponent<TabDocViewProps> { static _allTabs = new ObservableSet<TabDocView>(); + public static AllTabDocs() { + return Array.from(TabDocView._allTabs) + .filter(tv => tv._document) + .map(tv => tv._document!); + } _mainCont: HTMLDivElement | null = null; _tabReaction: IReactionDisposer | undefined; @@ -294,7 +300,7 @@ export class TabDocView extends ObservableReactComponent<TabDocViewProps> { @observable _isActive: boolean = false; @observable _isAnyChildContentActive = false; public static IsSelected = (doc?: Doc) => { - if (Array.from(doc?.[DocViews] ?? []).some(dv => dv?.IsSelected)) { + if (DocumentView.getViews(doc).some(dv => dv?.IsSelected)) { return true; } return false; |
