diff --git a/src/js/tab.js b/src/js/tab.js new file mode 100644 index 000000000..fcc293ec5 --- /dev/null +++ b/src/js/tab.js @@ -0,0 +1,10 @@ +const locationHash = window.location.hash; + +if (locationHash) { + const tabsList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tab"]')); + const matchedTabs = tabsList.filter(tab => tab.hash === locationHash); + + matchedTabs.map(tab => { + new bootstrap.Tab(tab).show(); + }); +} diff --git a/src/js/tabler.js b/src/js/tabler.js index f221ae301..940c64715 100644 --- a/src/js/tabler.js +++ b/src/js/tabler.js @@ -3,6 +3,7 @@ import './autosize'; import './input-mask'; import './dropdown'; +import './tab'; (function() { /**