1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-22 01:44:25 +04:00
Files
tabler/core/js/src/tab.js

17 lines
427 B
JavaScript

import { Tab } from './bootstrap';
export const EnableActivationTabsFromLocationHash = () => {
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 Tab(tab).show();
});
}
}
EnableActivationTabsFromLocationHash()