| | |
| | | tab = '#settingstab' + (rcmail.env.action=='preferences' ? 'default' : (rcmail.env.action.indexOf('identity')>0 ? 'identities' : rcmail.env.action.replace(/\./g, ''))); |
| | | |
| | | $(tab).addClass('tablink-selected'); |
| | | $(tab + '> a').removeAttr('onclick').unbind('click').bind('click', function(){return false;}); |
| | | $(tab + '> a').removeAttr('onclick').click(function() { return false; }); |
| | | } |
| | | |
| | | function rcube_show_advanced(visible) |
| | |
| | | // Warning: don't place "caller" <script> inside page element (id) |
| | | function rcube_init_tabs(id, current) |
| | | { |
| | | var content = document.getElementById(id), |
| | | // get fieldsets of the higher-level (skip nested fieldsets) |
| | | fs = $('fieldset', content).not('fieldset > fieldset'); |
| | | var content = $('#'+id), |
| | | fs = content.children('fieldset'); |
| | | |
| | | if (!fs.length) |
| | | return; |
| | |
| | | fs.each(function(idx) { if (idx != current) $(this).hide(); }); |
| | | |
| | | // create tabs container |
| | | var tabs = $('<div>').addClass('tabsbar').appendTo($(content)); |
| | | var tabs = $('<div>').addClass('tabsbar').appendTo(content); |
| | | |
| | | // convert fildsets into tabs |
| | | fs.each(function(idx) { |
| | | var tab, a, elm = $(this), |
| | | // get first legend element |
| | | legend = $(elm).children('legend'); |
| | | var tab, a, elm = $(this), legend = elm.children('legend'); |
| | | |
| | | // create a tab |
| | | a = $('<a>').text(legend.text()).attr('href', '#'); |
| | | tab = $('<span>').attr({'id': 'tab'+idx, 'class': 'tablink'}) |
| | | .click(function() { return rcube_show_tab(id, idx); }) |
| | | .click(function() { rcube_show_tab(id, idx); return false }) |
| | | |
| | | // remove legend |
| | | legend.remove(); |
| | |
| | | |
| | | function rcube_show_tab(id, index) |
| | | { |
| | | var content = document.getElementById(id), |
| | | fs = $('fieldset', content).not('fieldset > fieldset'); |
| | | var fs = $('#'+id).children('fieldset'); |
| | | |
| | | fs.each(function(idx) { |
| | | // Show/hide fieldset (tab content) |
| | |
| | | mailboxmenu: {id:'mailboxoptionsmenu', above:1}, |
| | | composemenu: {id:'composeoptionsmenu', editable:1}, |
| | | // toggle: #1486823, #1486930 |
| | | uploadmenu: {id:'attachment-form', editable:1, above:1, toggle:!bw.ie&&!bw.linux } |
| | | uploadmenu: {id:'attachment-form', editable:1, above:1, toggle:!bw.ie&&!bw.linux }, |
| | | uploadform: {id:'upload-form', editable:1, toggle:!bw.ie&&!bw.linux } |
| | | }; |
| | | |
| | | var obj; |
| | |
| | | |
| | | if (show && ref) { |
| | | var parent = $(ref).parent(), |
| | | win = $(window), |
| | | pos = parent.hasClass('dropbutton') ? parent.offset() : $(ref).offset(); |
| | | |
| | | if (!above && pos.top + ref.offsetHeight + obj.height() > window.innerHeight) |
| | | if (!above && pos.top + ref.offsetHeight + obj.height() > win.height()) |
| | | above = true; |
| | | if (pos.left + obj.width() > win.width()) |
| | | pos.left = win.width() - obj.width() - 30; |
| | | |
| | | obj.css({ left:pos.left, top:(pos.top + (above ? -obj.height() : ref.offsetHeight)) }); |
| | | } |
| | |
| | | if (rcmail.env.action == 'compose') |
| | | rcmail_ui.init_compose_form(); |
| | | } |
| | | else if (rcmail.env.task == 'addressbook') { |
| | | rcmail.addEventListener('afterupload-photo', function(){ rcmail_ui.show_popup('uploadform', false); }); |
| | | } |
| | | } |
| | | |
| | | // Events handling in iframes (eg. preview pane) |