From c033fb38e259f62e9651da73caab2ff8ebc22a2b Mon Sep 17 00:00:00 2001 From: akhuoa Date: Fri, 6 Dec 2024 11:03:55 +1300 Subject: [PATCH] Load connectivity graph only after the element is in view --- src/components/ConnectivityInfo.vue | 31 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/components/ConnectivityInfo.vue b/src/components/ConnectivityInfo.vue index e42f357..45c9539 100644 --- a/src/components/ConnectivityInfo.vue +++ b/src/components/ConnectivityInfo.vue @@ -81,7 +81,7 @@ -
+
{{ entry.paths }}
@@ -209,13 +209,15 @@
-
- +
+
@@ -304,6 +306,7 @@ export default { uberons: [{ id: undefined, name: undefined }], connectivityError: null, timeoutID: undefined, + graphViewLoaded: false, } }, watch: { @@ -406,13 +409,11 @@ export default { switchConnectivityView: function (val) { this.activeView = val; - if (val === 'graphView') { - const connectivityGraphRef = this.$refs.connectivityGraphRef; - if (connectivityGraphRef && connectivityGraphRef.$el) { - connectivityGraphRef.$el.scrollIntoView({ - behavior: 'smooth', - }); - } + if (val === 'graphView' && !this.graphViewLoaded) { + // to load the connectivity graph only after the container is in view + this.$nextTick(() => { + this.graphViewLoaded = true; + }); } }, onTapNode: function (data) {