add tab index

This commit is contained in:
buzz-lightsnack-2007 2024-03-29 22:44:01 +08:00
parent f5c5a3c2b6
commit e34013b5f8
2 changed files with 10 additions and 6 deletions

View file

@ -10,10 +10,10 @@
<body> <body>
<main class="window-body has-space"> <main class="window-body has-space">
<menu role="tablist" for="settings_content"> <menu role="tablist" for="settings_content">
<button role="tab" for="settings" data-text="general"></button> <button role="tab" for="settings" data-text="general" tab="0"></button>
<button role="tab" for="filters" data-text="filters"></button> <button role="tab" for="filters" data-text="filters" tab="1"></button>
<button role="tab" for="storage" data-text="storage"></button> <button role="tab" for="storage" data-text="storage" tab="2"></button>
<button role="tab" for="about" data-text="about"></button> <button role="tab" for="about" data-text="about" tab="3"></button>
</menu> </menu>
<section class="view_main" id="settings_content"> <section class="view_main" id="settings_content">
<section role="tabpanel" id="settings"> <section role="tabpanel" id="settings">

View file

@ -61,7 +61,11 @@ class windowman {
); );
} }
text_element.innerText = text_inserted; if (text_element.tagName.toLowerCase().includes(`input`)) {
text_element.setAttribute(`placholder`, text_inserted);
} else {
text_element.innerText = text_inserted;
}
}); });
} }
@ -216,7 +220,7 @@ class windowman {
// Write the data. // Write the data.
secretariat.write( secretariat.write(
[`view`, window.location.href], [`view`, window.location.href],
this.getAttribute(`for`), parseInt(this.getAttribute(`tab`)),
1, 1,
); );
})(); })();