diff options
| author | bobzel <zzzman@gmail.com> | 2020-10-23 13:16:15 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-10-23 13:16:15 -0400 |
| commit | a7d5b7da561715c8f78cac94efe37cd4b6266188 (patch) | |
| tree | 62c1bcdb2d520fa740d14235f7f7266cf5158369 /src/client/views/collections | |
| parent | 5fdc26ef1dcf7ea1260ee6ea05a38b7f3746eb25 (diff) | |
fixed major performance/bug with replaceTab AddDocTab where they weren't in an action so lots of extra/wrong work was being done. Now switching slides should work when they open new tabs.
Diffstat (limited to 'src/client/views/collections')
| -rw-r--r-- | src/client/views/collections/CollectionDockingView.tsx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index 39a52fb6d..d2c065417 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -108,6 +108,7 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) { } @undoBatch + @action public static ReplaceTab(document: Doc, panelName: string, stack: any, addToSplit?: boolean): boolean { const instance = CollectionDockingView.Instance; if (!instance) return false; @@ -140,8 +141,15 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) { // Creates a split on any side of the docking view based on the passed input pullSide and then adds the Document to the requested side // @undoBatch + @action public static AddSplit(document: Doc, pullSide: string, stack?: any, panelName?: string) { if (document._viewType === CollectionViewType.Docking) return CurrentUserUtils.openDashboard(Doc.UserDoc(), document); + + const tab = Array.from(CollectionDockingView.Instance.tabMap).find(tab => tab.DashDoc === document); + if (tab) { + tab.header.parent.setActiveContentItem(tab.contentItem); + return true; + } const instance = CollectionDockingView.Instance; if (!instance) return false; const docContentConfig = CollectionDockingView.makeDocumentConfig(document, panelName); |
