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() {