OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/assets/javascripts/angular/directives/timelines/timeline-column-name-direct...

24 lines
786 B

angular.module('openproject.timelines.directives')
.directive('timelineColumnName', ['I18n', 'CustomFieldHelper', function(I18n, CustomFieldHelper) {
return {
restrict: 'A',
scope: {
columnName: '=',
customFields: '=',
localePrefix: '@'
},
link: function(scope, element) {
if (CustomFieldHelper.isCustomFieldKey(scope.columnName)) {
scope.$watch('customFields', function(){
var customFieldId = CustomFieldHelper.getCustomFieldId(scope.columnName);
if (scope.customFields && scope.customFields[customFieldId]) {
element.html(scope.customFields[customFieldId].name);
}
});
} else {
element.html(I18n.t(scope.localePrefix + '.' + scope.columnName));
}
}
};
}]);