From db1a87cd6c506f2afbd1a37c64cb56ae11120b49 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 17 Dec 2010 10:07:04 -0500
Subject: [PATCH] Update branch for 0.5-rc release

---
 skins/default/functions.js |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/skins/default/functions.js b/skins/default/functions.js
index 82f7c15..77cdeb8 100644
--- a/skins/default/functions.js
+++ b/skins/default/functions.js
@@ -26,7 +26,11 @@
 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 @@
 
   // 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', '#');
@@ -124,9 +130,12 @@
     show = false;
 
   if (show && ref) {
-    var pos = $(ref).offset();
+    var parent = $(ref).parent(),
+      pos = parent.hasClass('dropbutton') ? parent.offset() : $(ref).offset();
+
     if (!above && pos.top + ref.offsetHeight + obj.height() > window.innerHeight)
       above = true;
+
     obj.css({ left:pos.left, top:(pos.top + (above ? -obj.height() : ref.offsetHeight)) });
   }
 
@@ -344,7 +353,7 @@
 /* Message composing */
 init_compose_form: function()
 {
-  var f, field, fields = ['cc', 'bcc', 'replyto', 'mailreplyto', 'mailfollowupto'],
+  var f, field, fields = ['cc', 'bcc', 'replyto', 'followupto'],
     div = document.getElementById('compose-div'),
     headers_div = document.getElementById('compose-headers-div');
 

--
Gitblit v1.9.1