+
{{- range $index, $element := $.Scratch.Get "tabs" -}}
{{- $lang := $langPane -}}
diff --git a/website_and_docs/static/js/tabpane-persist.js b/website_and_docs/static/js/tabpane-persist.js
index 0adf31cedd92..910768d38765 100644
--- a/website_and_docs/static/js/tabpane-persist.js
+++ b/website_and_docs/static/js/tabpane-persist.js
@@ -1,4 +1,30 @@
+var tabContents = document.querySelectorAll('.tab-content.persist');
+if (tabContents.length > 1) {
+ const persistTab = document.querySelector('ul.persist').querySelectorAll('.nav-link');
+ var heightMap = {};
+
+ // select each persist tab and store calculated heights
+ persistTab.forEach((langTab) => {
+ langTab.click();
+ tabContents.forEach((tabContent) => {
+ heightMap[tabContent.id] ||= [];
+ heightMap[tabContent.id].push(tabContent.clientHeight);
+ })
+ // everything ends up active unless classes removed
+ document.querySelectorAll('.active.show').forEach((activeTab) => {
+ activeTab.classList.remove('active');
+ activeTab.classList.remove('show');
+ })
+ })
+ // need to make something active/shown again
+ persistTab[0].click();
+
+ tabContents.forEach((tabContent) => {
+ tabContent.style.height = Math.max.apply(Math, heightMap[tabContent.id]).toString() + 'px';
+ })
+}
+
if (typeof Storage !== 'undefined') {
let activeLanguage = localStorage.getItem('active_language');