mirror of
https://github.com/imfing/hextra.git
synced 2025-06-19 23:01:19 -04:00
fix: properly handle tabs overflow (#422)
* fix: properly handle tabs overflow * chore: rebuild css
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
document.querySelectorAll('.tabs-toggle').forEach(function (button) {
|
||||
document.querySelectorAll('.hextra-tabs-toggle').forEach(function (button) {
|
||||
button.addEventListener('click', function (e) {
|
||||
// set parent tabs to unselected
|
||||
const tabs = Array.from(e.target.parentElement.querySelectorAll('.tabs-toggle'));
|
||||
const tabs = Array.from(e.target.parentElement.querySelectorAll('.hextra-tabs-toggle'));
|
||||
tabs.map(tab => tab.dataset.state = '');
|
||||
|
||||
// set current tab to selected
|
||||
e.target.dataset.state = 'selected';
|
||||
|
||||
// set all panels to unselected
|
||||
const panelsContainer = e.target.parentElement.nextElementSibling;
|
||||
const panelsContainer = e.target.parentElement.parentElement.nextElementSibling;
|
||||
Array.from(panelsContainer.children).forEach(function (panel) {
|
||||
panel.dataset.state = '';
|
||||
});
|
||||
|
Reference in New Issue
Block a user