fix: remove extra space for rendered link

chore: update theme info

chore: use dataset

chore: support editURL config option

* add toc and search config option

chore: update head template
This commit is contained in:
Xin
2023-08-12 19:53:14 +01:00
parent 03ae8b3dd5
commit d66ae7146f
8 changed files with 44 additions and 23 deletions

View File

@ -2,19 +2,19 @@ document.querySelectorAll('.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'));
tabs.map(tab => tab.setAttribute('data-state', ''));
tabs.map(tab => tab.dataset.state = '');
// set current tab to selected
e.target.setAttribute('data-state', 'selected');
e.target.dataset.state = 'selected';
// set all panels to unselected
const panelsContainer = e.target.parentElement.nextElementSibling;
Array.from(panelsContainer.children).forEach(function (panel) {
panel.setAttribute('data-state', '');
panel.dataset.state = '';
});
const panelId = e.target.getAttribute('aria-controls');
const panel = panelsContainer.querySelector(`#${panelId}`);
panel.setAttribute('data-state', 'selected');
panel.dataset.state = 'selected';
});
});