Elastic: Fix height of select elements inside of composite fields

also make them pretty when added programatically.
pull/6612/head
Aleksander Machniak 5 years ago
parent 9a757aa688
commit 43499432a5

@ -6850,6 +6850,8 @@ function rcube_webmail()
else if (colprop.type == 'composite') {
var i, childcol, cp, first, templ, cols = [], suffices = [], content = cell;
row.addClass('composite');
if (compact)
content = $('<div class="content input-group-text">');

@ -745,11 +745,15 @@ function rcmail_contact_form($form, $record, $attrib = null)
}
$colprop['id'] = 'ff_' . $col . intval($coltypes[$field]['count']);
$row_class = 'row';
// render composite field
if ($colprop['type'] == 'composite') {
$composite = array(); $j = 0;
$template = $RCMAIL->config->get($col . '_template', '{'.join('} {', array_keys($colprop['childs'])).'}');
$row_class .= ' composite';
$composite = array();
$template = $RCMAIL->config->get($col . '_template', '{'.join('} {', array_keys($colprop['childs'])).'}');
$j = 0;
foreach ($colprop['childs'] as $childcol => $cp) {
if (!empty($val) && is_array($val)) {
$childvalue = $val[$childcol] ?: $val[$j];
@ -847,11 +851,11 @@ function rcmail_contact_form($form, $record, $attrib = null)
$val .= $_del_btn;
}
$rows .= html::div('row', $_label . $val);
$rows .= html::div($row_class, $_label . $val);
}
// row without label
else {
$rows .= html::div('row', $compact ? $val : html::div('contactfield', $val));
$rows .= html::div($row_class, $compact ? $val : html::div('contactfield', $val));
}
}

@ -177,7 +177,6 @@ input.smart-upload {
& > *:first-child {
.overflow-ellipsis;
min-width: 8rem;
height: auto;
&:not(select) {
padding: 0;
@ -204,6 +203,9 @@ input.smart-upload {
select {
text-align: left;
}
&.composite select {
height: auto;
}

@ -736,7 +736,12 @@ function rcube_elastic_ui()
// Add date format placeholder to datepicker inputs
var func, format = rcmail.env.date_format_localized;
if (format) {
func = function(input) { $(input).filter('.datepicker').attr('placeholder', format); };
func = function(input) {
$(input).filter('.datepicker').attr('placeholder', format);
// also make selects pretty
$(input).parent().find('select').each(function() { pretty_select(this); });
};
$('input.datepicker').each(function() { func(this); });
rcmail.addEventListener('insert-edit-field', func);
}

Loading…
Cancel
Save