Merge pull request #9994 from spowelljr/addBackupTabDisplay

site: fix display method for tabs if jQuery fails to load
pull/10021/head
Medya Ghazizadeh 2020-12-21 10:59:03 -08:00 committed by GitHub
commit 75cd178012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -77,3 +77,8 @@ div.code-tabs h2 {
div.code-tabs h3 {
font-size: 1.1rem !important;
}
div.code-tabs h3.backup-tab-title {
font-size: 1.7rem !important;
font-weight: 600;
margin-top: 1.3rem;
}

View File

@ -1,5 +1,6 @@
/* Tabs JS implementation. Borrowed from Skaffold */
function initTabs() {
try{
$('.tab-content').find('.tab-pane').each(function(idx, item) {
var navTabs = $(this).closest('.code-tabs').find('.nav-tabs'),
title = $(this).attr('title'),
@ -27,7 +28,17 @@ function initTabs() {
tab.addClass('active');
tabPane.addClass('active');
});
} catch(e) {
const elements = document.getElementsByClassName("tab-pane");
for (let element of elements) {
element.style.display = "block";
const title = document.createElement("h3");
title.innerText = element.title;
title.classList.add("backup-tab-title");
element.prepend(title);
}
}
}
const getTabSelector = currElement => {
let osSelector = '.'+getUserOS();