From 4f95329c1e261e915292203029d4f96369fe8646 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 7 Feb 2014 10:38:02 -0800 Subject: [PATCH] CRM-13966 - Style regular selects to more or less match select2 --- CRM/Core/Form/Renderer.php | 3 +++ css/civicrm.css | 21 +++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CRM/Core/Form/Renderer.php b/CRM/Core/Form/Renderer.php index ad22dd4d66..3665afb9a2 100644 --- a/CRM/Core/Form/Renderer.php +++ b/CRM/Core/Form/Renderer.php @@ -176,6 +176,9 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { } } + if ($type == 'select' && $element->getAttribute('multiple')) { + $type = 'multiselect'; + } $class = ($class ? "$class " : '') . 'crm-form-' . $type; if ($required) { diff --git a/css/civicrm.css b/css/civicrm.css index c1c77a7279..ae3ff81521 100644 --- a/css/civicrm.css +++ b/css/civicrm.css @@ -216,11 +216,6 @@ div.crm-container fieldset label{ background-color: #B0B0B0; } -.crm-container select { - vertical-align: middle; - border: 1px solid #999; -} - .crm-container .crm-form-block { padding: 4px; margin-bottom: 4px; @@ -229,7 +224,8 @@ div.crm-container fieldset label{ color: #3E3E3E; } -.crm-container textarea { +.crm-container textarea, +.crm-container .crm-form-multiselect { border: 1px solid #999; } @@ -3792,6 +3788,19 @@ div.m ul#civicrm-menu, background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%); background-image: linear-gradient(top, #eee 1%, #fff 15%); } +.crm-container select.crm-form-select { + border: 1px solid #aaa; + color: #444; + height: 2.2em; + padding: 4px; + border-radius: 4px; + background-color: #fff; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff)); + background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%); + background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0); + background-image: linear-gradient(top, #fff 0%, #eee 50%); +} /* Add arrow icon to multi-selects */ .crm-container .select2-container-multi .select2-choices:before { background: url("../packages/jquery/plugins/select2/select2.png") no-repeat scroll 0 -4px; -- 2.25.1