Issue #3362409 by durifal, mrinalini9, klausi, mcdruid, poker10: Vertical tabs result in jQuery error when overlay-context hashtag is added to URL

merge-requests/5460/head
mcdruid 2023-11-13 10:20:00 +00:00
parent ecf339b6d9
commit ca316a5cbc
No known key found for this signature in database
1 changed files with 5 additions and 2 deletions

View File

@ -50,8 +50,11 @@ Drupal.behaviors.verticalTabs = {
if (!tab_focus) {
// 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 && $(this).find(window.location.hash).length) {
tab_focus = $(this).find(window.location.hash).closest('.vertical-tabs-pane');
// Remove any characters that jquery does not accept in find().
var hash = window.location.hash.replace(/[=%;,\/]/g, "");
if (hash !== '#' && $(this).find(hash).length) {
tab_focus = $(this).find(hash).closest('.vertical-tabs-pane');
}
else {
tab_focus = $('> .vertical-tabs-pane:first', this);