Skip to content
Snippets Groups Projects
Commit 093f99a7 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #376293 by casey, Dave Reid, droidenator, moshe weitzman: activate...

- Patch #376293 by casey, Dave Reid, droidenator, moshe weitzman: activate current vertical tab from URL fragment.
parent afdf0f6c
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -49,7 +49,14 @@ Drupal.behaviors.verticalTabs = {
$('> li:last', tab_list).addClass('last');
if (!tab_focus) {
tab_focus = $('> .vertical-tabs-pane:first', this);
// If the current URL has a fragment and one of the tabs contains an
// element that matches the URL fragment, activate that tab.
if (window.location.hash && $(window.location.hash, this).length) {
tab_focus = $(window.location.hash, this).closest('.vertical-tabs-pane');
}
else {
tab_focus = $('> .vertical-tabs-pane:first', this);
}
}
if (tab_focus.length) {
tab_focus.data('verticalTab').focus();
......
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