-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (20 loc) · 903 Bytes
/
Copy pathscript.js
File metadata and controls
24 lines (20 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//Fully load the DOM before running the script
document.addEventListener("DOMContentLoaded", function() {
console.log("DOM fully loaded and parsed");
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl)
})
document.querySelectorAll('#nav-tab>[data-bs-toggle="tab"]').forEach(el => {
el.addEventListener('shown.bs.tab', () => {
const target = el.getAttribute('data-bs-target')
const scrollElem = document.querySelector(`${target} [data-bs-spy="scroll"]`)
bootstrap.ScrollSpy.getOrCreateInstance(scrollElem).refresh()
})
})
// Code to overwrite ARIA attributes
const elementsToFix = document.getElementsByClassName('fa');
elementsToFix.forEach(element => {
element.setAttribute("aria-hidden", "false");
});
});