| | |
| | | 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; |
| | | |
| | |
| | | |
| | | // 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', '#'); |
| | |
| | | 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)) }); |
| | | } |
| | | |
| | |
| | | /* 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'); |
| | | |