From 06d5018a7694c6e4ad39517259cfe0055359a3ca Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 13 Oct 2015 17:54:44 -0400 Subject: [PATCH] CRM-16415 - Fix icons in popups --- css/civicrm.css | 10 ---------- js/Common.js | 18 ++++++++++++++++-- js/crm.ajax.js | 4 ++-- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/css/civicrm.css b/css/civicrm.css index 71e180efda..831d273b38 100644 --- a/css/civicrm.css +++ b/css/civicrm.css @@ -3218,16 +3218,6 @@ div.m ul#civicrm-menu, .select2-drop .crm-entityref-filters select.active { border: 1px solid #808080; } -/* Icons used by entityRef create buttons */ -.crm-container .Individual-profile-icon { - background-position: -144px -96px; -} -.crm-container .Household-profile-icon { - background-position: 0 -112px; -} -.crm-container .Organization-profile-icon { - background-position: -112px -112px; -} /* Style autocomplete results */ .crm-container .select2-results { font-size: 12px; diff --git a/js/Common.js b/js/Common.js index c2134fa802..41634344ea 100644 --- a/js/Common.js +++ b/js/Common.js @@ -745,9 +745,23 @@ if (!CRM.vars) CRM.vars = {}; createLinks = params.contact_type ? _.where(CRM.config.entityRef.contactCreate, {type: params.contact_type}) : CRM.config.entityRef.contactCreate; } _.each(createLinks, function(link) { + var icon; + switch (link.type) { + case 'Individual': + icon = 'fa-user'; + break; + + case 'Organization': + icon = 'fa-building'; + break; + + case 'Household': + icon = 'fa-home'; + break; + } markup += ' '; - if (link.type) { - markup += ' '; + if (icon) { + markup += ' '; } markup += link.label + ''; }); diff --git a/js/crm.ajax.js b/js/crm.ajax.js index 96a6df7377..58a09a6efb 100644 --- a/js/crm.ajax.js +++ b/js/crm.ajax.js @@ -487,8 +487,8 @@ if ($icon.length) { button.icons = {primary: $icon.attr('class')}; } else { - var action = $el.attr('crm-icon') || ($el.hasClass('cancel') ? 'times' : 'check'); - button.icons = {primary: 'fa-' + action}; + var action = $el.attr('crm-icon') || ($el.hasClass('cancel') ? 'fa-times' : 'fa-check'); + button.icons = {primary: action}; } buttons.push(button); added.push(identifier); -- 2.25.1