From 796cc0c112e3eb6d809d55ca77f3a2419075d5cb Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 23 Mar 2010 19:11:52 +0000 Subject: - Patch #567224 by mathiaz.sk: vertical tabs appears, even if empty. --- misc/vertical-tabs.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'misc') diff --git a/misc/vertical-tabs.js b/misc/vertical-tabs.js index edf9a6108..ba43c8f88 100644 --- a/misc/vertical-tabs.js +++ b/misc/vertical-tabs.js @@ -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 = $(''); $(this).wrap('
').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) -- cgit v1.2.3