forked from drowl87/hextra_mirror
fix: properly handle tabs overflow (#422)
* fix: properly handle tabs overflow * chore: rebuild css
This commit is contained in:
@ -914,9 +914,15 @@ video {
|
||||
.hx-overflow-x-hidden {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.hx-overflow-y-hidden {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.hx-overscroll-contain {
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
.hx-overscroll-x-contain {
|
||||
overscroll-behavior-x: contain;
|
||||
}
|
||||
.hx-text-ellipsis {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
@ -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