diff options
author | bobzel <zzzman@gmail.com> | 2023-07-03 10:41:32 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-07-03 10:41:32 -0400 |
commit | ed5cf4bdac69daa373474f439dc474b9f53e1b4a (patch) | |
tree | 88f6effa07135e3d8f1ec96f6e7daaa9e945bbdf /src | |
parent | 446ab35c19ae18a609acf26babbc4e6dc1c46876 (diff) |
fixed making one tab always active.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/TabDocView.tsx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx index 83edc60df..f6220a6b8 100644 --- a/src/client/views/collections/TabDocView.tsx +++ b/src/client/views/collections/TabDocView.tsx @@ -52,8 +52,14 @@ export class TabDocView extends React.Component<TabDocViewProps> { @observable _isActive: boolean = false; @observable _isAnyChildContentActive = false; @computed get _isContentActive() { - return SelectionManager.Views().some(view => view.rootDoc === this._document) || this._isAnyChildContentActive; + const tabs = Array.from(CollectionDockingView.Instance?.tabMap ?? new Set()); + return ( + SelectionManager.Views().some(view => view.rootDoc === this._document) || + this._isAnyChildContentActive || + (tabs.findIndex(tab => tab.DashDoc === this._document) === 0 && !tabs.some(tab => SelectionManager.Views().some(dv => dv.rootDoc === tab.DashDoc))) + ); } + @observable _document: Doc | undefined; @observable _view: DocumentView | undefined; @@ -414,11 +420,7 @@ export class TabDocView extends React.Component<TabDocViewProps> { tabView = () => this._view; disableMinimap = () => !this._document || this._document.layout !== CollectionView.LayoutString(Doc.LayoutFieldKey(this._document)) || this._document?._type_collection !== CollectionViewType.Freeform; whenChildContentActiveChanges = (isActive: boolean) => (this._isAnyChildContentActive = isActive); - tabs = () => Array.from(CollectionDockingView.Instance?.tabMap ?? new Set()); - isContentActive = () => - SelectionManager.Views().some(dv => dv.rootDoc === this._document) || - this._isAnyChildContentActive || - (this.tabs().findIndex(tab => tab.DashDoc === this._document) === 0 && !this.tabs().some(tab => SelectionManager.Views().some(dv => dv.rootDoc === tab.DashDoc))); + isContentActive = () => this._isContentActive; @computed get docView() { return !this._activated || !this._document ? null : ( <> |