diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-07-24 16:56:31 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-07-24 16:56:31 +0000 |
commit | 093f99a794e0ff6107fbd052560b0ecfb5ca623e (patch) | |
tree | eba2ffda28dd1fbff6eeaee5f488a38bf32d7c9e /misc | |
parent | afdf0f6cbc05615ea2b093ef5940a83870b0b569 (diff) | |
download | brdo-093f99a794e0ff6107fbd052560b0ecfb5ca623e.tar.gz brdo-093f99a794e0ff6107fbd052560b0ecfb5ca623e.tar.bz2 |
- Patch #376293 by casey, Dave Reid, droidenator, moshe weitzman: activate current vertical tab from URL fragment.
Diffstat (limited to 'misc')
-rw-r--r-- | misc/vertical-tabs.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/misc/vertical-tabs.js b/misc/vertical-tabs.js index fb4b91a6f..0c66ec6c1 100644 --- a/misc/vertical-tabs.js +++ b/misc/vertical-tabs.js @@ -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(); |