From 1d75570324abe035cdae61a261cfb63d8ed6550f Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Fri, 24 Jun 2022 19:33:31 +1000
Subject: Fix ancestry_bar/tut_pane redundant-resizing bug

---
 src/App.vue | 34 +++++++++++++++++++++++-----------
 1 file changed, 23 insertions(+), 11 deletions(-)

(limited to 'src/App.vue')

diff --git a/src/App.vue b/src/App.vue
index a8c98f8..db7292f 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -295,9 +295,11 @@ export default defineComponent({
 			let doExpansion = () => {
 				LayoutNode.hideUpward(layoutNode, this.layoutMap);
 				this.activeRoot = layoutNode;
-				// Repeatedly relayout tiles during ancestry-bar transition
-				this.ancestryBarInTransition = true;
-				this.relayoutDuringAncestryBarTransition();
+				if (this.detachedAncestors.length == 0){
+					// Repeatedly relayout tiles during ancestry-bar transition
+					this.ancestryBarInTransition = true;
+					this.relayoutDuringAncestryBarTransition();
+				}
 				//
 				return this.updateAreaDims().then(() => {
 					this.overflownRoot = false;
@@ -350,8 +352,10 @@ export default defineComponent({
 			LayoutNode.hideUpward(layoutNode, this.layoutMap);
 			this.activeRoot = layoutNode;
 			// Repeatedly relayout tiles during ancestry-bar transition
-			this.ancestryBarInTransition = true;
-			this.relayoutDuringAncestryBarTransition();
+			if (this.detachedAncestors.length == 0){
+				this.ancestryBarInTransition = true;
+				this.relayoutDuringAncestryBarTransition();
+			}
 			//
 			this.updateAreaDims().then(() => this.relayoutWithCollapse());
 		},
@@ -364,8 +368,10 @@ export default defineComponent({
 			this.activeRoot = layoutNode;
 			this.overflownRoot = false;
 			// Repeatedly relayout tiles during ancestry-bar transition
-			this.ancestryBarInTransition = true;
-			this.relayoutDuringAncestryBarTransition();
+			if (layoutNode.parent == null){
+				this.ancestryBarInTransition = true;
+				this.relayoutDuringAncestryBarTransition();
+			}
 			//
 			if (alsoCollapse){
 				this.onNonleafClick(layoutNode, true);
@@ -870,8 +876,11 @@ export default defineComponent({
 				}
 			}, 100);
 			setTimeout(() => {
-				clearTimeout(timerId);
-				console.log('Reached timeout waiting for transition-end event');
+				if (this.ancestryBarInTransition){
+					this.ancestryBarInTransition = false;
+					clearTimeout(timerId);
+					console.log('Reached timeout waiting for ancestry-bar transition-end event');
+				}
 			}, this.uiOpts.tileChgDuration * 3);
 		},
 		tutPaneTransitionEnd(){
@@ -885,8 +894,11 @@ export default defineComponent({
 				}
 			}, 100);
 			setTimeout(() => {
-				clearTimeout(timerId);
-				console.log('Reached timeout waiting for transition-end event');
+				if (this.tutPaneInTransition){
+					this.tutPaneInTransition = false;
+					clearTimeout(timerId);
+					console.log('Reached timeout waiting for tutorial-pane transition-end event');
+				}
 			}, this.uiOpts.tileChgDuration * 3);
 		},
 	},
-- 
cgit v1.2.3

