Commit cf500087 authored by colemanw's avatar colemanw

CRM-13823 - Show icons in Angular tabs

parent b1f92f72
......@@ -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}}">
......
......@@ -661,6 +661,7 @@
restrict: 'EA',
scope: {
crmTitle: '@',
crmIcon: '@',
count: '@',
id: '@'
},
......@@ -845,8 +846,11 @@
.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> ');
}
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment