diff --git a/skins/elastic/styles/widgets/forms.less b/skins/elastic/styles/widgets/forms.less index d477272a5..febbdf2e9 100644 --- a/skins/elastic/styles/widgets/forms.less +++ b/skins/elastic/styles/widgets/forms.less @@ -70,6 +70,11 @@ html.ms .propform { margin-left: 0; /* fixes checkbox alignment with other inputs in a form */ } } + + td.form-control-plaintext { + padding-top: ~"calc(1rem - 1px * 2)"; + padding-bottom: ~"calc(1rem - 1px * 2)"; + } } .formbuttons { diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index 7a8e1352e..1ad163df4 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -285,20 +285,24 @@ function rcube_elastic_ui() $('input,select,textarea', $('table.propform')).not('[type=checkbox]').addClass('form-control'); $('[type=checkbox]', $('table.propform')).addClass('form-check-input'); $('table.propform > tbody > tr').each(function() { - var row = $(this), + var first, last, row = $(this), row_classes = ['form-group', 'row'], cells = row.children('td'); if (cells.length == 2) { - cells.first().addClass('col-form-label'); - $('label', cells.first()).addClass('col-form-label'); + first = cells.first(); + last = cells.last(); - cells.first().addClass('col-sm-4'); - cells.last().addClass('col-sm-8'); + $('label', first).addClass('col-form-label'); + first.addClass('col-sm-4 col-form-label'); + last.addClass('col-sm-8'); - if (cells.last().find('[type=checkbox]').length) { + if (last.find('[type=checkbox]').length) { row_classes.push('form-check'); } + else if (!last.find('input,textarea,radio').length) { + last.addClass('form-control-plaintext'); + } } row.addClass(row_classes.join(' '));