announce disabled icons

This commit is contained in:
mi
2025-11-14 18:36:36 +10:00
parent ff8bdf9a31
commit 7e41401ca3
2 changed files with 16 additions and 8 deletions

View File

@@ -188,9 +188,11 @@
if (currentNumber > 1) {
firstBtn.className = isIconNav ? 'btn-icon-nav' : 'btn btn-nav';
firstBtn.onclick = (e) => { e.preventDefault(); loadComic(1); };
firstBtn.removeAttribute('aria-disabled');
} else {
firstBtn.className = isIconNav ? 'btn-icon-nav btn-icon-disabled' : 'btn btn-nav btn-disabled';
firstBtn.onclick = null;
firstBtn.setAttribute('aria-disabled', 'true');
}
// Previous button
@@ -198,9 +200,11 @@
if (currentNumber > 1) {
prevBtn.className = isIconNav ? 'btn-icon-nav' : 'btn btn-nav';
prevBtn.onclick = (e) => { e.preventDefault(); loadComic(currentNumber - 1); };
prevBtn.removeAttribute('aria-disabled');
} else {
prevBtn.className = isIconNav ? 'btn-icon-nav btn-icon-disabled' : 'btn btn-nav btn-disabled';
prevBtn.onclick = null;
prevBtn.setAttribute('aria-disabled', 'true');
}
// Comic date display
@@ -213,9 +217,11 @@
if (currentNumber < totalComics) {
nextBtn.className = isIconNav ? 'btn-icon-nav' : 'btn btn-nav';
nextBtn.onclick = (e) => { e.preventDefault(); loadComic(currentNumber + 1); };
nextBtn.removeAttribute('aria-disabled');
} else {
nextBtn.className = isIconNav ? 'btn-icon-nav btn-icon-disabled' : 'btn btn-nav btn-disabled';
nextBtn.onclick = null;
nextBtn.setAttribute('aria-disabled', 'true');
}
// Latest button
@@ -223,9 +229,11 @@
if (currentNumber < totalComics) {
latestBtn.className = isIconNav ? 'btn-icon-nav' : 'btn btn-nav';
latestBtn.onclick = (e) => { e.preventDefault(); loadComic(totalComics); };
latestBtn.removeAttribute('aria-disabled');
} else {
latestBtn.className = isIconNav ? 'btn-icon-nav btn-icon-disabled' : 'btn btn-nav btn-disabled';
latestBtn.onclick = null;
latestBtn.setAttribute('aria-disabled', 'true');
}
}