Nothing saved yet.
// The native close event carries the value of the control that closed it. document.getElementById('settings').addEventListener('close', (e) => { document.getElementById('settings-result').textContent = e.target.returnValue === 'saved' ? 'Saved.' : 'Closed without saving.'; }); // The tabs. The recipe draws the row; who is selected, which panel shows and where // the one tab stop sits are the app's - a tablist whose arrows do nothing announces // more than plain buttons and does less. This is the whole handler. const tabs = [...document.querySelectorAll('#settings [role="tab"]')]; const showTab = (tab) => { for (const t of tabs) { const on = t === tab; t.setAttribute('aria-selected', String(on)); t.tabIndex = on ? 0 : -1; document.getElementById(t.getAttribute('aria-controls')).hidden = !on; } tab.focus(); }; tabs.forEach((tab, i) => { tab.addEventListener('click', () => showTab(tab)); tab.addEventListener('keydown', (e) => { const step = e.key === 'ArrowRight' ? 1 : e.key === 'ArrowLeft' ? -1 : 0; if (step) { e.preventDefault(); showTab(tabs[(i + step + tabs.length) % tabs.length]); } }); }); const d = document.querySelector('dialog.aparte-dialog'); if (d) d.showModal();