summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-11-10 12:44:13 +0000
committeralecpl <alec@alec.pl>2010-11-10 12:44:13 +0000
commit7403abdac961a4779169e537ee0cf29b359d9e8a (patch)
treed96b539b87f69e530fe9dff0607747c38e492acc
parente3af1f2d6d8e9f5dd88edc365af7bd889d06d285 (diff)
- Fix for nested fieldsets (inside tabbed fieldsets)
-rw-r--r--skins/default/functions.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/skins/default/functions.js b/skins/default/functions.js
index d5e38d5cd..3197c9847 100644
--- a/skins/default/functions.js
+++ b/skins/default/functions.js
@@ -26,7 +26,11 @@ function rcube_show_advanced(visible)
function rcube_init_tabs(id, current)
{
var content = document.getElementById(id),
- fs = $('fieldset', content);
+ // get fieldsets of the higher-level (skip nested fieldsets)
+ fs = $('fieldset', content).not('fieldset > fieldset');
+
+ if (!fs.length)
+ return;
current = current ? current : 0;
@@ -38,7 +42,9 @@ function rcube_init_tabs(id, current)
// convert fildsets into tabs
fs.each(function(idx) {
- var tab, a, elm = $(this), legend = $('legend', elm);
+ var tab, a, elm = $(this),
+ // get first legend element
+ legend = $(elm).children('legend');
// create a tab
a = $('<a>').text(legend.text()).attr('href', '#');