diff --git a/src/components/ScrollableTab.jsx b/src/components/ScrollableTab.jsx index afe31ab..9641bd8 100644 --- a/src/components/ScrollableTab.jsx +++ b/src/components/ScrollableTab.jsx @@ -136,6 +136,7 @@ function ScrollableTab({ onActiveTabChange, sonificationType, children }) { onHoverTab(eventElement.id); } }} + id="scrollTabList" > , ]; +var sizeAdded = false; + function StartPage2() { const [activeTabIndex, setActiveTabIndex] = useState(0); const onActiveTabChange = (index) => { + if (!sizeAdded) { + const scrollableTabList = document.getElementById("scrollTabList"); + const tabSize = scrollableTabList ? scrollableTabList.offsetHeight : 0; + + var container = document.getElementById("heatmapOverlay"); + container.style.height = document.body.scrollHeight + tabSize + "px"; + document.getElementById("studySiteContainer").style.height = + document.body.scrollHeight + tabSize + "px"; + sizeAdded = true; + } setActiveTabIndex(index); }; diff --git a/src/pages/study_site_3/StartPage3.jsx b/src/pages/study_site_3/StartPage3.jsx index 29dc289..a66a8c8 100644 --- a/src/pages/study_site_3/StartPage3.jsx +++ b/src/pages/study_site_3/StartPage3.jsx @@ -31,6 +31,8 @@ import ProgrammeEvents from "./tab_content/ProgrammeEvents"; import StudentLife from "./tab_content/StudentLife"; import AboutUVV from "./tab_content/AboutUVV"; +var sizeAdded = false; + function StartPage3({ redirectLoc }) { const [activeTabIndex, setActiveTabIndex] = useState(0); @@ -48,6 +50,16 @@ function StartPage3({ redirectLoc }) { ]; const onActiveTabChange = (index) => { + if (!sizeAdded) { + const scrollableTabList = document.getElementById("scrollTabList"); + const tabSize = scrollableTabList ? scrollableTabList.offsetHeight : 0; + + var container = document.getElementById("heatmapOverlay"); + container.style.height = document.body.scrollHeight + tabSize + "px"; + document.getElementById("studySiteContainer").style.height = + document.body.scrollHeight + tabSize + "px"; + sizeAdded = true; + } setActiveTabIndex(index); }; diff --git a/src/pages/study_site_5/StartPage5.jsx b/src/pages/study_site_5/StartPage5.jsx index a06e616..586ba97 100644 --- a/src/pages/study_site_5/StartPage5.jsx +++ b/src/pages/study_site_5/StartPage5.jsx @@ -27,6 +27,8 @@ import PropertyOutsideSpace from "./tab_content/PropertyOutsideSpace"; import PropertyNotices from "./tab_content/PropertyNotices"; import PropertyContact from "./tab_content/PropertyContact"; +var sizeAdded = false; + function StartPage5({ redirectLoc }) { const [activeTabIndex, setActiveTabIndex] = useState(0); @@ -44,6 +46,16 @@ function StartPage5({ redirectLoc }) { ]; const onActiveTabChange = (index) => { + if (!sizeAdded) { + const scrollableTabList = document.getElementById("scrollTabList"); + const tabSize = scrollableTabList ? scrollableTabList.offsetHeight : 0; + + var container = document.getElementById("heatmapOverlay"); + container.style.height = document.body.scrollHeight + tabSize + "px"; + document.getElementById("studySiteContainer").style.height = + document.body.scrollHeight + tabSize + "px"; + sizeAdded = true; + } setActiveTabIndex(index); }; @@ -68,7 +80,7 @@ function StartPage5({ redirectLoc }) { Overview - + Features diff --git a/src/pages/study_site_5/tab_content/PropertyFeatures.jsx b/src/pages/study_site_5/tab_content/PropertyFeatures.jsx index dcb41a2..f4ff082 100644 --- a/src/pages/study_site_5/tab_content/PropertyFeatures.jsx +++ b/src/pages/study_site_5/tab_content/PropertyFeatures.jsx @@ -6,7 +6,7 @@ function PropertyFeatures() {
  • Open Plan Living and Dining Area
  • Hardwood Floors
  • High-Speed Internet
  • -
  • In-Uni Laundry
  • +
  • In-Unit Laundry
  • ); }