From 3c5c7be2c84f4afeff045727ebd4f33622e2de2b Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 24 Aug 2020 21:45:05 -0400
Subject: fixed saving order of golden layout tabs

---
 src/client/views/collections/CollectionDockingView.tsx | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'src/client/views/collections/CollectionDockingView.tsx')

diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 9ed3247ae..e7f54ff86 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -631,7 +631,15 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) {
         }
     }
 
+    stackActiveChanged = () => {
+        try {
+            CollectionDockingView.Instance._ignoreStateChange = JSON.stringify(CollectionDockingView.Instance._goldenLayout.toConfig());
+            this.stateChanged();
+        } catch (e) { } // catch exception thrown when config has not been initialzed yet
+    }
+
     stackCreated = (stack: any) => {
+        stack.layoutManager.on("activeContentItemChanged", this.stackActiveChanged);
         //stack.header.controlsContainer.find('.lm_popout').hide();
         stack.header.element.on('mousedown', (e: any) => {
             if (e.target === stack.header.element[0] && e.button === 1) {
-- 
cgit v1.2.3-70-g09d2

