From fbc052e5df573f60a56f2f8ebdffb0b0bec6c6e6 Mon Sep 17 00:00:00 2001 From: PhilW Date: Thu, 21 Feb 2019 07:37:04 +0000 Subject: [PATCH] (Elastic) hide advanced settings sections --- skins/elastic/styles/widgets/forms.less | 20 ++++++++++++++++++++ skins/elastic/ui.js | 10 ++++++++++ 2 files changed, 30 insertions(+) diff --git a/skins/elastic/styles/widgets/forms.less b/skins/elastic/styles/widgets/forms.less index a3ebc1c2a..164dffe3f 100644 --- a/skins/elastic/styles/widgets/forms.less +++ b/skins/elastic/styles/widgets/forms.less @@ -377,6 +377,26 @@ input.smart-upload { } } +fieldset.advanced { + > legend { + width: auto; + cursor: pointer; + + &:after { + &:extend(.font-icon-class); + float: right; + margin: 0 0 0 .25rem; + line-height: inherit; + font-size: inherit; + content: @fa-var-angle-up; + } + + &.closed:after { + content: @fa-var-angle-down; + } + } +} + @media screen and (max-width: @screen-width-bs-phone) { .formcontent .text-only { .form-group:not(tr) { diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index f9be082bf..64a481ee0 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -909,6 +909,16 @@ function rcube_elastic_ui() }); }); + // Advanced options form + $('fieldset.advanced', context).each(function() { + var table = $(this).children('.propform').first(); + table.wrap($('
').addClass('collapse')); + $(this).children('legend').first().addClass('closed').on('click', function() { + table.parent().collapse('toggle'); + $(this).toggleClass('closed'); + }); + }); + // Other forms, e.g. Insert response $('.propform > .prop.block:not(.row)', context).each(function() { $(this).addClass('form-group row').each(function() {