From: Coleman Watts Date: Sat, 8 Feb 2014 00:17:42 +0000 (-0800) Subject: CRM-13966 - select2 style tweaks X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0bdc50a16e4f3823ec849a0cfc2888c8a4ddf228;hp=66fed21796381e34274022fed662297c0a383b52;p=civicrm-core.git CRM-13966 - select2 style tweaks --- diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php index d6b47e9503..fa56341936 100644 --- a/CRM/Contact/Form/Edit/Address.php +++ b/CRM/Contact/Form/Edit/Address.php @@ -66,20 +66,14 @@ class CRM_Contact_Form_Edit_Address { $form->applyFilter('__ALL__', 'trim'); $js = array(); - if ( !$inlineEdit ) { - $js = array('onChange' => 'checkLocation( this.id );'); + if (!$inlineEdit) { + $js = array('onChange' => 'checkLocation( this.id );'); } - $form->addElement('select', - "address[$blockId][location_type_id]", - ts('Location Type'), - array( - '' => ts('- select -')) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'), - $js - ); + $form->addSelect("address[$blockId][location_type_id]", array('data-api-entity' => 'address', 'class' => 'six') + $js); - if ( !$inlineEdit ) { - $js = array('id' => 'Address_' . $blockId . '_IsPrimary', 'onClick' => 'singleSelect( this.id );'); + if (!$inlineEdit) { + $js = array('id' => 'Address_' . $blockId . '_IsPrimary', 'onClick' => 'singleSelect( this.id );'); } else { //make location type required for inline edit diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index 878f42c96c..d7a6c833d4 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -371,7 +371,7 @@ class CRM_Contact_Form_Search_Criteria { CRM_Core_BAO_Address::addStateCountryMap($stateCountryMap); // extend addresses with proximity search - $form->addElement('text', 'prox_distance', ts('Find contacts within')); + $form->addElement('text', 'prox_distance', ts('Find contacts within'), array('class' => 'six')); $form->addElement('select', 'prox_distance_unit', NULL, array('miles' => ts('Miles'), 'kilos' => ts('Kilometers'))); // is there another form rule that does decimals besides money ? ... diff --git a/css/civicrm.css b/css/civicrm.css index ae41b77a42..5421b6a593 100644 --- a/css/civicrm.css +++ b/css/civicrm.css @@ -2438,7 +2438,8 @@ div.grippie { } .crm-container .button .icon, -.crm-container .crm-button .icon { +.crm-container .crm-button .icon, +.crm-accordion-header .icon { background-image: url("../i/icons/jquery-ui-FFFFFF.png"); } .crm-container .button:hover .icon, @@ -2619,10 +2620,13 @@ div.grippie { .crm-container .crm-hover-button { display: inline-block; border: 1px solid transparent; + opacity: .7; +} +.crm-container .crm-accordion-header a.crm-hover-button { + opacity: 1; } .crm-container .crm-hover-button:hover, .crm-container .crm-hover-button:active { - background: #ccc; background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(1, #ccc)); background-image: -webkit-linear-gradient(center bottom, #eee 0%, #ccc 100%); background-image: -moz-linear-gradient(center bottom, #eee 0%, #ccc 100%); @@ -2630,6 +2634,7 @@ div.grippie { background-image: linear-gradient(top, #eee 0%, #ccc 100%); border: 1px solid #AAAAAA; border-radius: 4px; + opacity: 1; } .crm-container .crm-hover-button .icon { margin-left: 3px; @@ -2741,20 +2746,6 @@ div.grippie { background-color: #2E3471; } -.crm-container .crm-accordion-header a.crm-close-accordion { - font-weight: normal !important; - float: right; - color: #FFF !important; -} - -.crm-container .crm-accordion-header a.crm-close-accordion span { - visibility: hidden; -} - -.crm-container .crm-accordion-header a.crm-close-accordion:hover span { - visibility: visible; -} - .crm-container .crm-master-accordion-header.crm-accordion-header:hover, .crm-container .crm-collapsible .collapsible-title:hover { background-color: transparent; diff --git a/templates/CRM/Contact/Form/Inline/Address.tpl b/templates/CRM/Contact/Form/Inline/Address.tpl index 2a08dff6c6..82a95651ea 100644 --- a/templates/CRM/Contact/Form/Inline/Address.tpl +++ b/templates/CRM/Contact/Form/Inline/Address.tpl @@ -83,7 +83,7 @@ cj('.crm-inline-edit.address').each(function() { if (ok && cj(this).data('location-type-id') == lt) { var label = cj('option:selected', ele).text(); - ele.val(''); + ele.select2('val', ''); ele.crmError(label + "{/literal} {ts escape='js'}has already been assigned to another address. Please select another location for this address.{/ts}"{literal}); ok = false; } diff --git a/templates/CRM/Contact/Form/Inline/Email.tpl b/templates/CRM/Contact/Form/Inline/Email.tpl index 4a4c800e07..f7c77e9965 100644 --- a/templates/CRM/Contact/Form/Inline/Email.tpl +++ b/templates/CRM/Contact/Form/Inline/Email.tpl @@ -70,14 +70,6 @@ cj(function($) { // check first primary radio $('#Email_1_IsPrimary').prop('checked', true ); - - // error handling / show hideen elements duing form validation - $('tr[id^="Email_Block_"]' ).each( function() { - if( $(this).find('td:first span').length > 0 ) { - $(this).removeClass('hiddenElement'); - } - }); }); - {/literal} diff --git a/templates/CRM/Contact/Form/Search/AdvancedCriteria.tpl b/templates/CRM/Contact/Form/Search/AdvancedCriteria.tpl index a989d150f4..1d1a981333 100644 --- a/templates/CRM/Contact/Form/Search/AdvancedCriteria.tpl +++ b/templates/CRM/Contact/Form/Search/AdvancedCriteria.tpl @@ -91,7 +91,7 @@ cj(function($) { var body = $('.crm-accordion-body.' + id); if (header.length > 0 && body.length > 0 && !body.html()) { body.html('
{/literal}{ts escape='js'}Loading{/ts}{literal}...
'); - header.append('{/literal}{ts escape='js'}Reset{/ts}  {literal}'); + header.append('{/literal}{literal}'); header.addClass('active'); CRM.loadPage(url, {target: body, block: false}); } diff --git a/templates/CRM/Contact/Form/Search/Builder.js b/templates/CRM/Contact/Form/Search/Builder.js index 8319feca54..fedc9fb6c7 100644 --- a/templates/CRM/Contact/Form/Search/Builder.js +++ b/templates/CRM/Contact/Form/Search/Builder.js @@ -62,7 +62,7 @@ $('.crm-search-value select', row).remove(); $('input[id^=value]', row) .hide() - .after(''); + .after(''); fetchOptions(row, field); } diff --git a/templates/CRM/Contact/Form/Search/table.tpl b/templates/CRM/Contact/Form/Search/table.tpl index 87b60a50be..17a1ab096d 100644 --- a/templates/CRM/Contact/Form/Search/table.tpl +++ b/templates/CRM/Contact/Form/Search/table.tpl @@ -41,7 +41,7 @@ {$form.value[$x][$i].html|crmAddClass:'required'} {if $i gt 0 or $x gt 1} -   X +   {/if} diff --git a/templates/CRM/Contact/Page/View/Summary.js b/templates/CRM/Contact/Page/View/Summary.js index c7a7cd42df..5f5f97baed 100644 --- a/templates/CRM/Contact/Page/View/Summary.js +++ b/templates/CRM/Contact/Page/View/Summary.js @@ -36,7 +36,7 @@ $('form', o).validate(CRM.validate.params); ajaxFormParams.data = data; $('form', o).ajaxForm(ajaxFormParams); - o.trigger('crmFormLoad'); + o.trigger('crmLoad').trigger('crmFormLoad'); }); } };