Fix alignment of static text entries in .propform

pull/5742/merge
Aleksander Machniak 7 years ago
parent 8a29c2a5f7
commit a4f46d3735

@ -70,6 +70,11 @@ html.ms .propform {
margin-left: 0; /* fixes checkbox alignment with other inputs in a form */ 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 { .formbuttons {

@ -285,20 +285,24 @@ function rcube_elastic_ui()
$('input,select,textarea', $('table.propform')).not('[type=checkbox]').addClass('form-control'); $('input,select,textarea', $('table.propform')).not('[type=checkbox]').addClass('form-control');
$('[type=checkbox]', $('table.propform')).addClass('form-check-input'); $('[type=checkbox]', $('table.propform')).addClass('form-check-input');
$('table.propform > tbody > tr').each(function() { $('table.propform > tbody > tr').each(function() {
var row = $(this), var first, last, row = $(this),
row_classes = ['form-group', 'row'], row_classes = ['form-group', 'row'],
cells = row.children('td'); cells = row.children('td');
if (cells.length == 2) { if (cells.length == 2) {
cells.first().addClass('col-form-label'); first = cells.first();
$('label', cells.first()).addClass('col-form-label'); last = cells.last();
cells.first().addClass('col-sm-4'); $('label', first).addClass('col-form-label');
cells.last().addClass('col-sm-8'); 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'); row_classes.push('form-check');
} }
else if (!last.find('input,textarea,radio').length) {
last.addClass('form-control-plaintext');
}
} }
row.addClass(row_classes.join(' ')); row.addClass(row_classes.join(' '));

Loading…
Cancel
Save