From a07afa5322d8e57ff009e28354eb6210de692657 Mon Sep 17 00:00:00 2001 From: Coleman Watts <coleman@civicrm.org> Date: Fri, 27 Dec 2013 21:39:34 -0800 Subject: [PATCH] Contact summary tabs - simplify styling --- css/civicrm.css | 3 ++- templates/CRM/Contact/Page/View/Summary.tpl | 8 +------- templates/CRM/Tag/Form/Tag.tpl | 4 +++- templates/CRM/common/TabHeader.tpl | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/css/civicrm.css b/css/civicrm.css index 3e112c9559..d5ae236bf9 100644 --- a/css/civicrm.css +++ b/css/civicrm.css @@ -3592,7 +3592,8 @@ tbody.scrollContent tr.alternateRow { #mainTabContainer li.disabled { text-decoration: none; } -#mainTabContainer li.disabled a:link { +#mainTabContainer li.disabled a.ui-tabs-anchor, +#mainTabContainer li.crm-count-0 a.ui-tabs-anchor { color: #999999 !important; } #crm-container tr.crm-job { diff --git a/templates/CRM/Contact/Page/View/Summary.tpl b/templates/CRM/Contact/Page/View/Summary.tpl index 48cc955d07..0225cb6372 100644 --- a/templates/CRM/Contact/Page/View/Summary.tpl +++ b/templates/CRM/Contact/Page/View/Summary.tpl @@ -356,18 +356,12 @@ {* CRM-10560 *} {literal} <script type="text/javascript"> -cj(document).ready(function($) { +cj(function($) { $('.crm-inline-edit-container').crmFormContactLock({ ignoreLabel: "{/literal}{ts escape='js'}Ignore{/ts}{literal}", saveAnywayLabel: "{/literal}{ts escape='js'}Save Anyway{/ts}{literal}", reloadLabel: "{/literal}{ts escape='js'}Reload Page{/ts}{literal}" }); - //Enhance styling of "View Contact" tabs to indicate empty/non-empty tags - $('div#mainTabContainer ul').find('li').each(function(n){ - if($(this).find('em').html()==0){ - $(this).addClass("disabled"); - } - }); }); </script> {/literal} diff --git a/templates/CRM/Tag/Form/Tag.tpl b/templates/CRM/Tag/Form/Tag.tpl index 9905ae8946..4a8e70fef0 100644 --- a/templates/CRM/Tag/Form/Tag.tpl +++ b/templates/CRM/Tag/Form/Tag.tpl @@ -73,7 +73,9 @@ }); // showing count of tags in summary tab $('a em', $tab).html('' + tags.length); - tags.length ? $tab.removeClass('disabled') : $tab.addClass('disabled'); + $tab + .removeClass($tab.attr('class').match(/(crm-count-\d+)/)[0]) + .addClass('crm-count-' + tags.length); // update summary tab $("#tags").html(tags.join(', ')); }; diff --git a/templates/CRM/common/TabHeader.tpl b/templates/CRM/common/TabHeader.tpl index 353748da81..93d9f898ec 100644 --- a/templates/CRM/common/TabHeader.tpl +++ b/templates/CRM/common/TabHeader.tpl @@ -24,10 +24,10 @@ +--------------------------------------------------------------------+ *} -{* enclosed all tabs and its content in a block *} {* include wysiwyg related files*} {include file="CRM/common/wysiwyg.tpl" includeWysiwygEditor=true} +{* enclose all tabs and its content in a block *} <div class="crm-block crm-content-block"> {if $tabHeader and count($tabHeader) gt 1} <div id="mainTabContainer"> -- GitLab