Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/google/docsy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorDiego Molina <diemol@users.noreply.github.com>2021-08-25 00:15:53 +0300
committerGitHub <noreply@github.com>2021-08-25 00:15:53 +0300
commit9bf8b8cbf016131f80487412c3236d41e853e8ee (patch)
tree55bfb0da84950b1021c44d2c1ed8ff666e087e0a /static
parent11c68e58d1d3dfbaf108ce52de3ffc5e2925fb50 (diff)
Fixing infinite loop when several tabs are present
Based on how Bootstrap suggests to select tabs https://getbootstrap.com/docs/4.6/components/navs/#tabshow
Diffstat (limited to 'static')
-rw-r--r--static/js/tabpane-persist.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/static/js/tabpane-persist.js b/static/js/tabpane-persist.js
index 9d3883f..8a02bb6 100644
--- a/static/js/tabpane-persist.js
+++ b/static/js/tabpane-persist.js
@@ -4,15 +4,16 @@ if (typeof Storage !== 'undefined') {
document
.querySelectorAll('.tab-' + activeLanguage)
.forEach((element) => {
- element.click();
+ $('#' + element.id).tab('show');
});
}
}
function handleClick(language) {
if (typeof Storage !== 'undefined') {
localStorage.setItem('active_language', language);
- document.querySelectorAll('.tab-' + language).forEach((element) => {
- element.click();
+ document.querySelectorAll('.tab-' + language)
+ .forEach((element) => {
+ $('#' + element.id).tab('show');
});
}
}