Elastic: Use select.custom-select instead of select.form-control

It's just better looking.
pull/6287/head
Aleksander Machniak 7 years ago
parent 430c000e32
commit fc88c5b1f6

@ -6857,7 +6857,7 @@ function rcube_webmail()
} }
else if (colprop.type == 'select') { else if (colprop.type == 'select') {
input = $('<select>') input = $('<select>')
.addClass('form-control ff_' + col) .addClass('custom-select ff_' + col)
.attr({ name: '_' + col + name_suffix, id: input_id }); .attr({ name: '_' + col + name_suffix, id: input_id });
var options = input.attr('options'); var options = input.attr('options');

@ -567,7 +567,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
foreach ($coltypes as $col => $prop) { foreach ($coltypes as $col => $prop) {
if ($prop['subtypes']) { if ($prop['subtypes']) {
$subtype_names = array_map('rcmail_get_type_label', $prop['subtypes']); $subtype_names = array_map('rcmail_get_type_label', $prop['subtypes']);
$select_subtype = new html_select(array('name' => '_subtype_'.$col.'[]', 'class' => 'contactselectsubtype form-control', 'title' => $prop['label'] . ' ' . $RCMAIL->gettext('type'))); $select_subtype = new html_select(array('name' => '_subtype_'.$col.'[]', 'class' => 'contactselectsubtype custom-select', 'title' => $prop['label'] . ' ' . $RCMAIL->gettext('type')));
$select_subtype->add($subtype_names, $prop['subtypes']); $select_subtype->add($subtype_names, $prop['subtypes']);
$coltypes[$col]['subtypes_select'] = $select_subtype->show(); $coltypes[$col]['subtypes_select'] = $select_subtype->show();
} }

@ -681,9 +681,15 @@ function rcube_elastic_ui()
} }
// Forms // Forms
var supported_controls = 'input:not(.button,[type=button],[type=file],[type=radio],[type=checkbox]),select,textarea'; var supported_controls = 'input:not(.button,[type=button],[type=file],[type=radio],[type=checkbox]),textarea';
$(supported_controls, $('.propform', context)).addClass('form-control'); $(supported_controls, $('.propform', context)).addClass('form-control');
$('[type=checkbox]', $('.propform', context)).addClass('form-check-input'); $('[type=checkbox]', $('.propform', context)).addClass('form-check-input');
$('select', context).addClass('custom-select');
if (context != document) {
$(supported_controls, context).addClass('form-control');
}
$('table.propform', context).each(function() { $('table.propform', context).each(function() {
var text_rows = 0, form_rows = 0; var text_rows = 0, form_rows = 0;
@ -844,11 +850,6 @@ function rcube_elastic_ui()
table.find('thead').addClass('thead-default'); table.find('thead').addClass('thead-default');
}); });
$('.toolbarmenu select', context).addClass('form-control');
if (context != document) {
$(supported_controls, context).addClass('form-control');
}
// The same for some other checkboxes // The same for some other checkboxes
// We do this here, not in setup() because we want to cover dialogs // We do this here, not in setup() because we want to cover dialogs
$('input.pretty-checkbox, .propform input[type=checkbox], .form-check > input, .popupmenu.form input[type=checkbox], .toolbarmenu input[type=checkbox]', context) $('input.pretty-checkbox, .propform input[type=checkbox], .form-check > input, .popupmenu.form input[type=checkbox], .toolbarmenu input[type=checkbox]', context)
@ -890,7 +891,7 @@ function rcube_elastic_ui()
$(this).addClass('form-group row'); $(this).addClass('form-group row');
label.parent().css('display', 'none'); label.parent().css('display', 'none');
input.addClass('form-control') input.addClass(input.is('select') ? 'custom-select' : 'form-control')
.attr('placeholder', label.text()) .attr('placeholder', label.text())
.before($('<span class="input-group-prepend">').append(icon)) .before($('<span class="input-group-prepend">').append(icon))
.parent().addClass('input-group'); .parent().addClass('input-group');

Loading…
Cancel
Save