From b9a68b516abe3b56a4c927b4994d3f67ca8f2c93 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Sun, 21 Jan 2018 12:36:05 +0100 Subject: [PATCH] Make editity encryption view appear correctly in classic skin --- program/js/app.js | 1 + skins/classic/functions.js | 16 +++++++++++----- skins/classic/templates/identityedit.html | 7 ++++++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index 4ff79be89..297a3c9db 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -4066,6 +4066,7 @@ function rcube_webmail() .on('click', function() { ref.mailvelope_keyring.openSettings(); }); container.show(); + ref.triggerEvent('identity-encryption-show', { container: container }); }) .catch(function(err) { console.error('Mailvelope keyring error', err); diff --git a/skins/classic/functions.js b/skins/classic/functions.js index 51012fe36..3e98f9286 100644 --- a/skins/classic/functions.js +++ b/skins/classic/functions.js @@ -53,16 +53,19 @@ function rcube_init_tabs(id, current) current = current ? current : 0; - // first hide not selected tabs - fs.each(function(idx) { if (idx != current) $(this).hide(); }); - - // create tabs container - var tabs = $('
').addClass('tabsbar').appendTo(content); + // create tabs container (if not exists) + var tabs = content.find('.tabsbar'); + if (!tabs.length) + tabs = $('
').addClass('tabsbar').appendTo(content); // convert fildsets into tabs fs.each(function(idx) { var tab, a, elm = $(this), legend = elm.children('legend'); + // skip invisible or already initialized fieldsets + if (!elm.is(':visible') || elm.hasClass('tabbed')) + return; + // create a tab a = $('').text(legend.text()).attr('href', '#'); tab = $('').attr({'id': 'tab'+idx, 'class': 'tablink'}) @@ -79,6 +82,9 @@ function rcube_init_tabs(id, current) // add the tab to container tab.append(a).appendTo(tabs); }); + + // hide not selected tabs + fs.each(function(idx) { if (idx != current) $(this).hide(); }); } function rcube_show_tab(id, index) diff --git a/skins/classic/templates/identityedit.html b/skins/classic/templates/identityedit.html index b0ecef9ac..6f661b38f 100644 --- a/skins/classic/templates/identityedit.html +++ b/skins/classic/templates/identityedit.html @@ -18,7 +18,12 @@
- +