Skip to content

Commit

Permalink
[BSv5] Fixes script for persisting tabpanes (google#1378)
Browse files Browse the repository at this point in the history
  • Loading branch information
deining authored and dseynaev committed Jan 29, 2023
1 parent c46d93f commit f52c960
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions static/js/tabpane-persist.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ if (typeof Storage !== 'undefined') {
document
.querySelectorAll('.persistLang-' + activeLanguage)
.forEach((element) => {
$('#' + element.id).tab('show');
new bootstrap.Tab(element).show();
});
}
}
function persistLang(language) {
console.log("Klicked persistlang");
if (typeof Storage !== 'undefined') {
localStorage.setItem('active_language', language);
document.querySelectorAll('.persistLang-' + language)
.forEach((element) => {
$('#' + element.id).tab('show');
.forEach((element) => {
new bootstrap.Tab(element).show();
});
}
}

0 comments on commit f52c960

Please sign in to comment.