From 478d73f69d6c58e9cba2009a12de77c123582b83 Mon Sep 17 00:00:00 2001 From: funkonaut Date: Tue, 6 Sep 2022 13:22:26 -0500 Subject: [PATCH] Announce menu collapse and expand Role tag added as aria-expanded does not work for clickable headings, this is some what of a work around but will get things accessible for now wihtout requiring too much of a rewrite. The showHide function now has lines to toggle the aria-expanded tag based on the state of the clickable heading. --- scripts/boxesserver | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/boxesserver b/scripts/boxesserver index 3eaeec0..16123b7 100755 --- a/scripts/boxesserver +++ b/scripts/boxesserver @@ -189,9 +189,11 @@ class BServer: if(e.style.display == null || e.style.display == "none") { e.style.display = "block"; h.classList.add("open"); + h.setAttribute("aria-expanded","true"); } else { e.style.display = "none"; h.classList.remove("open"); + h.setAttribute("aria-expanded","false"); } } function hideargs() { @@ -245,7 +247,7 @@ class BServer: if len(group._group_actions) == 1 and isinstance(group._group_actions[0], argparse._HelpAction): continue prefix = getattr(group, "prefix", None) - result.append('''

%s

\n\n''' % (groupid, groupid, groupid, _(group.title), groupid)) + result.append('''

%s

\n\n''' % (groupid, groupid, groupid, _(group.title), groupid)) for a in group._group_actions: if a.dest in ("input", "output"): @@ -345,7 +347,7 @@ class BServer: """ ] for nr, group in enumerate(self.groups): result.append(f''' -