CRM-13823 - Show icons in Angular tabs
authorColeman Watts <coleman@civicrm.org>
Fri, 23 Oct 2015 19:03:15 +0000 (15:03 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 23 Oct 2015 19:03:15 +0000 (15:03 -0400)
ang/crmStatusPage/StatusPage.html
ang/crmUi.js
ang/crmUi/tabset.html

index fa49b3a0800ade9e7384bb52052a7ea04432dd3a..efbe3c98d114118270092f3ee6126fef68ea32d2 100644 (file)
@@ -9,11 +9,12 @@
 
     <div crm-ui-tab-set>
       <div
-        ng-repeat="tab in [{is_visible: 1, name: 'visible'}, {is_visible: 0, name: 'hidden'}]"
+        ng-repeat="tab in [{is_visible: 1, name: 'visible', icon: 'fa-bell'}, {is_visible: 0, name: 'hidden', icon: 'fa-bell-slash-o'}]"
         crm-ui-tab
         id="tab-{{tab.name}}"
         count="{{_.where(statuses, {is_visible: tab.is_visible}).length}}"
         crm-title="tab.is_visible ? ts('Active') : ts('Hushed/Snoozed')"
+        crm-icon="{{tab.icon}}"
         >
         <div id="crm-status-list" ng-repeat="status in statuses | filter:{is_visible: tab.is_visible}" >
           <h3 class="crm-severity-{{status.severity}}">
index 63ad95f2c868a2d427e7e6b6ca20575165fa9fa9..b01e897d3fde78b17f01281fef5f3e254784d9ab 100644 (file)
         restrict: 'EA',
         scope: {
           crmTitle: '@',
+          crmIcon: '@',
           count: '@',
           id: '@'
         },
     .directive('crmIcon', function() {
       return {
         restrict: 'EA',
-        scope: {},
         link: function (scope, element, attrs) {
+          if (element.is('[crm-ui-tab]')) {
+            // handled in crmUiTab ctrl
+            return;
+          }
           if (attrs.crmIcon.substring(0,3) == 'fa-') {
             $(element).prepend('<i class="crm-i ' + attrs.crmIcon + '"></i> ');
           }
index f2329379456b1278e26a93b60a6877a979421826..fafb1dfdac6d6d24e1e8dbacf8453a21fa6ca9f7 100644 (file)
@@ -2,6 +2,7 @@
   <ul>
     <li ng-repeat="tab in tabs" class="ui-corner-all crm-tab-button crm-count-{{tab.count}}">
       <a href="#{{tab.id}}">
+        <i ng-if="tab.crmIcon" class="crm-i {{tab.crmIcon}}"></i>
         {{tab.$parent.$eval(tab.crmTitle)}}
         <em ng-if="tab.count">{{tab.count}}</em>
       </a>