Commit 796cc0c1 authored by Dries's avatar Dries

- Patch #567224 by mathiaz.sk: vertical tabs appears, even if empty.

parent c061a16a
......@@ -18,12 +18,19 @@ Drupal.behaviors.verticalTabs = {
$('.vertical-tabs-panes', context).once('vertical-tabs', function () {
var focusID = $(':hidden.vertical-tabs-active-tab', this).val();
var focus;
// Check if there are some fieldsets that can be converted to vertical-tabs
var $fieldsets = $('> fieldset', this);
if ($fieldsets.length == 0) {
return;
}
// Create the tab column.
var list = $('<ul class="vertical-tabs-list"></ul>');
$(this).wrap('<div class="vertical-tabs clearfix"></div>').before(list);
// Transform each fieldset into a tab.
$('> fieldset', this).each(function () {
$fieldsets.each(function () {
var tab = new Drupal.verticalTab({ title: $('> legend', this).text(), fieldset: $(this) });
list.append(tab.item);
$(this)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment