<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}}">
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> ');
}
<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>