Skip to content
Snippets Groups Projects
Unverified Commit aa2cd693 authored by LucasC's avatar LucasC Committed by GitHub
Browse files

XWIKI-22169: Breadcrumb dropdowns for navigation should be keyboard accessible (#3376)

* Added a label to the tree toggle button
parent f7a4bb83
No related branches found
No related tags found
No related merge requests found
...@@ -4022,6 +4022,8 @@ rating.votes=Votes ...@@ -4022,6 +4022,8 @@ rating.votes=Votes
## Hierarchy ## Hierarchy
web.hierarchy.error=Failed to get the full hierarchy. web.hierarchy.error=Failed to get the full hierarchy.
web.hierarchy.label=Breadcrumb web.hierarchy.label=Breadcrumb
web.hierarchy.toggler.label.children=Toggle the hierarchy tree under {0}.
web.hierarchy.toggler.label.parents=Toggle the parent tree of {0}.
## XWiki Select Widget ## XWiki Select Widget
web.widgets.select.filter=Filter web.widgets.select.filter=Filter
......
...@@ -221,7 +221,14 @@ ...@@ -221,7 +221,14 @@
'showTranslations': $xwiki.isMultiLingual(), 'showTranslations': $xwiki.isMultiLingual(),
'showWikis': $showWikis 'showWikis': $showWikis
}) })
#if ($rootId)
#set ($togglerTextAlternative = "<span class='sr-only'>$escapetool.xml($services.localization.render('web.hierarchy.toggler.label.children', [$pathData.get($openToIndex).label])) </span>")
#else
## If the rootId is null, this means that the root is the home. Which means that we're on the first tree, which doesn't show exactly the same thing as the others.
#set ($togglerTextAlternative = "<span class='sr-only'>$escapetool.xml($services.localization.render('web.hierarchy.toggler.label.parents', [$pathData.get($openToIndex).label])) </span>")
#end
#set ($treeToggle = "<button class='dropdown-toggle' data-toggle='dropdown'>" + #set ($treeToggle = "<button class='dropdown-toggle' data-toggle='dropdown'>" +
$togglerTextAlternative +
"$services.icon.renderHTML('caret-down')</button>") "$services.icon.renderHTML('caret-down')</button>")
#set ($treeNavigation = "$treeToggle<div class='dropdown-menu'>#documentTree($treeParams)</div>") #set ($treeNavigation = "$treeToggle<div class='dropdown-menu'>#documentTree($treeParams)</div>")
#end #end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment