js: focus tab according to anchor in URL (#68102)
This commit is contained in:
parent
40114f3665
commit
c5c4772c5e
|
@ -356,6 +356,14 @@ var gadjo_js = gadjo_js || {};
|
|||
$(document.querySelectorAll('.pk-tabs')).each(function(i, el) {
|
||||
el.tabs = new gadjo_js.Tabs(el);
|
||||
});
|
||||
|
||||
/* focus tab from #open:<tab slug> anchor, 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) {
|
||||
$tab_button.parents('.pk-tabs')[0].tabs.selectTab($tab_button[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var storage = undefined;
|
||||
|
|
Loading…
Reference in New Issue