summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-07-24 16:56:31 +0000
committerDries Buytaert <dries@buytaert.net>2010-07-24 16:56:31 +0000
commit093f99a794e0ff6107fbd052560b0ecfb5ca623e (patch)
treeeba2ffda28dd1fbff6eeaee5f488a38bf32d7c9e /misc
parentafdf0f6cbc05615ea2b093ef5940a83870b0b569 (diff)
downloadbrdo-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.js9
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();