Index: vertical-tabs.css =================================================================== RCS file: /cvs/drupal/drupal/misc/vertical-tabs.css,v retrieving revision 1.6 diff -u -r1.6 vertical-tabs.css --- vertical-tabs.css 31 May 2009 00:51:41 -0000 1.6 +++ vertical-tabs.css 16 Sep 2009 16:49:25 -0000 @@ -4,7 +4,7 @@ margin: 1em 0 1em 15em; border: 1px solid #ccc; } -div.vertical-tabs ul.vertical-tabs-list { +div.vertical-tabs dl.vertical-tabs-list { width: 15em; list-style: none; list-style-image: none; /* IE6 */ @@ -25,7 +25,7 @@ } /* Layout of each tab */ -div.vertical-tabs ul.vertical-tabs-list li { +div.vertical-tabs dl.vertical-tabs-list dt { background: #eee; border: 1px solid #ccc; border-top: 0; @@ -33,36 +33,44 @@ margin: 0; height: 1%; } -div.vertical-tabs ul.vertical-tabs-list li a { +div.vertical-tabs dl.vertical-tabs-list dt a { display: block; text-decoration: none; padding: 0.5em 0.6em; line-height: 1.3em; height: 1%; } -div.vertical-tabs ul.vertical-tabs-list li a:focus { +div.vertical-tabs dl.vertical-tabs-list dt a:focus { + background-color: fuchsia; position: relative; z-index: 5; } -div.vertical-tabs ul.vertical-tabs-list li a:hover { + +div.vertical-tabs dl.vertical-tabs-list dt a:hover { + background-color: yellow; text-decoration: none; } -div.vertical-tabs ul.vertical-tabs-list li.selected { + +div.vertical-tabs dl.vertical-tabs-list dt.selected { background: #fff; border-right-width: 0; position: relative; } -div.vertical-tabs ul.vertical-tabs-list li.selected a:focus { + +div.vertical-tabs dl.vertical-tabs-list dt.selected a:focus { + background-color: lime; outline: 0; } -div.vertical-tabs ul.vertical-tabs-list li.selected strong, -div.vertical-tabs ul.vertical-tabs-list li.selected small { +div.vertical-tabs dl.vertical-tabs-list dd.selected strong, +div.vertical-tabs dl.vertical-tabs-list dd.selected small { color: #000; } -div.vertical-tabs ul.vertical-tabs-list .summary { +div.vertical-tabs dl.vertical-tabs-list .summary { display: block; + font-size: smaller; + padding-bottom: 0; } -div.vertical-tabs ul.vertical-tabs ul.vertical-tabs-list .summary { +div.vertical-tabs dl.vertical-tabs dl.vertical-tabs-list .summary { line-height: normal; margin-bottom: 0; } Index: vertical-tabs.js =================================================================== RCS file: /cvs/drupal/drupal/misc/vertical-tabs.js,v retrieving revision 1.7 diff -u -r1.7 vertical-tabs.js --- vertical-tabs.js 31 Aug 2009 05:51:08 -0000 1.7 +++ vertical-tabs.js 16 Sep 2009 16:44:30 -0000 @@ -19,12 +19,15 @@ var focusID = $(':hidden.vertical-tabs-active-tab', this).val(); var focus; // Create the tab column. - var list = $(''); + var list = $('
'); $(this).wrap('
').before(list); // Transform each fieldset into a tab. $('> fieldset', this).each(function () { - var tab = new Drupal.verticalTab({ title: $('> legend', this).text(), fieldset: $(this) }); + var tab = new Drupal.verticalTab({ + title: $('> legend', this).text(), + fieldset: $(this) + }); list.append(tab.item); $(this) .removeClass('collapsible collapsed') @@ -35,8 +38,8 @@ } }); - $('> li:first', list).addClass('first'); - $('> li:last', list).addClass('last'); + $('> dd:first', list).addClass('first'); + $('> dd:last', list).addClass('last'); if (!focus) { focus = $('> .vertical-tabs-pane:first', this); @@ -63,6 +66,27 @@ return false; }); + // Keyboard events added: + // Releasing the Enter key will open the tab + this.link.keyup(function(event) { + if (event.keyCode == 13) { + self.focus(); + // Set focus on the first input field of the visible fieldset + $("input:visible:enabled:first", $("fieldset.vertical-tabs-pane")).focus(); + return false; + } + }); + + // Releasing the Escape key lets you leave the tab + this.fieldset.keyup(function(event) { + if (event.keyCode == 27) { + self.focus(); + // Set focus on the selected tab button again + $(".vertical-tab-button.selected").focus(); + return false; + } + }); + this.fieldset .bind('summaryUpdated', function () { self.updateSummary(); @@ -108,10 +132,11 @@ */ Drupal.theme.prototype.verticalTab = function (settings) { var tab = {}; - tab.item = $('
  • ') - .append(tab.link = $('') + tab.item = $('
    ') + //.append(tab.link = $('') + .append(tab.link = $('') .append(tab.title = $('').text(settings.title)) - .append(tab.summary = $('') + .append(tab.summary = $('
    ') ) ); return tab;