From 9c1ac43870a64881184fa6326ecd3cfb5e2c6efd Mon Sep 17 00:00:00 2001 From: Christian Bastian <80225746+cdb-boop@users.noreply.github.com> Date: Fri, 26 Jul 2024 22:16:39 -0400 Subject: [PATCH] Added tab scroll position memory. - Second attempt. Made tab content scroll instead of tab contents container. --- web/model-manager.css | 2 ++ web/model-manager.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/web/model-manager.css b/web/model-manager.css index 251928b..06f90f1 100644 --- a/web/model-manager.css +++ b/web/model-manager.css @@ -246,12 +246,14 @@ height: 100%; width: auto; overflow-x: auto; + overflow-y: hidden; } .model-manager .model-manager-body .tab-content { display: flex; flex-direction: column; height: 100%; + overflow-y: auto; } /* model info view */ diff --git a/web/model-manager.js b/web/model-manager.js index 667e111..c73c09e 100644 --- a/web/model-manager.js +++ b/web/model-manager.js @@ -445,9 +445,11 @@ function GenerateTabGroup(tabData) { }); tabContents.forEach((tabContent) => { if (name === tabContent.getAttribute("data-name")) { + tabContent.scrollTop = tabContent.dataset["scrollTop"] ?? 0; tabContent.style.display = ""; } else { + tabContent.dataset["scrollTop"] = tabContent.scrollTop; tabContent.style.display = "none"; } });