Skip to content
Snippets Groups Projects
Commit 7dc7c047 authored by Robert Lange's avatar Robert Lange
Browse files

refs #20375 [finc] set focus on hierarchy tab

* define hierarchy tree tab as ajax-loadable
* fix: set aria-controls for ajax tabs just-in-time to avoid reference of aria to unloaded tab-content, also #19938
parent 4e658fb6
No related merge requests found
......@@ -67,4 +67,15 @@ class HierarchyTree extends \VuFind\RecordTab\HierarchyTree
}
return false;
}
/**
* Can this tab be loaded via AJAX?
*
* @return bool
*/
public function supportsAjax()
{
// No, special width adjustment needed.
return true;
}
}
......@@ -274,6 +274,8 @@ function recordDocReady() {
// accessibility: mark tab controls as selected
$top.find('.record-tab.active').find('a').attr('aria-selected', 'false');
// accessibility: set information about connection between tab control and tab content
$(this).attr('aria-controls', tabid);
$('#' + tabid + '-tabselector').attr('aria-selected', 'true').attr('aria-controls', tabid);
// accessibility: set aria-hidden for content panes
......
......@@ -71,7 +71,7 @@
<a href="<?= $this->recordLink()->getTabUrl($this->driver, $tab) ?>#tabnav"
<?php if ($obj->supportsAjax() && in_array($tab, $this->backgroundTabs)): ?> data-background<?php endif ?>
aria-selected="<?= $isActiveTab ? "true" : "false" ?>"
aria-controls="<?= $tabName ?>"
<?php if($isActiveTab): ?>aria-controls="<?= $tabName ?>"<?php endif; ?>
id="<?= $tabName ?>-tabselector">
<?= $this->transEsc($desc) ?>
<span class="sr-only load-tab-content"><?= $this->transEsc('load_tab_content_hint') ?></span></a>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment