backoffice: allow for links to open a specific tab (#65194)
This commit is contained in:
parent
7be05db469
commit
6bb9dc4dc8
|
@ -7,6 +7,14 @@ $(function() {
|
|||
});
|
||||
$('h4.foldable.folded').next().hide();
|
||||
|
||||
/* focus tab from #open:<tab slug> anchor, used in documentation links
|
||||
* to point to open panel */
|
||||
if (document.location.hash && document.location.hash.indexOf('#open:') == 0) {
|
||||
const $tab_button = $('#tab-' + document.location.hash.substring(6) + '[role=tab]');
|
||||
if ($tab_button.length) {
|
||||
$('.pk-tabs')[0].tabs.selectTab($tab_button[0]);
|
||||
}
|
||||
}
|
||||
/* focus tab with error */
|
||||
$('.form-with-tabs .error').first().closest('[role=tabpanel]').each(function(idx, elem) {
|
||||
const $tab_button = $('[role=tab][aria-controls="' + $(elem).attr('id') + '"]');
|
||||
|
|
Loading…
Reference in New Issue