2015-07-04 03:25:25 +00:00
|
|
|
'use strict';
|
|
|
|
|
2015-11-12 22:24:26 +00:00
|
|
|
angular.module('forms').directive('fieldIconDirective', function() {
|
2016-06-01 01:06:45 +00:00
|
|
|
|
2015-07-04 03:25:25 +00:00
|
|
|
return {
|
2015-07-30 00:22:53 +00:00
|
|
|
template: '<i class="{{typeIcon}}"></i>',
|
2015-07-04 03:25:25 +00:00
|
|
|
restrict: 'E',
|
|
|
|
scope: {
|
|
|
|
typeName: '@'
|
|
|
|
},
|
|
|
|
controller: function($scope){
|
|
|
|
var iconTypeMap = {
|
2015-07-21 23:25:45 +00:00
|
|
|
'textfield': 'fa fa-pencil-square-o',
|
|
|
|
'dropdown': 'fa fa-th-list',
|
|
|
|
'date': 'fa fa-calendar',
|
|
|
|
'checkbox': 'fa fa-check-square-o',
|
|
|
|
'radio': 'fa fa-dot-circle-o',
|
|
|
|
'email': 'fa fa-envelope-o',
|
|
|
|
'textarea': 'fa fa-pencil-square',
|
|
|
|
'legal': 'fa fa-legal',
|
|
|
|
'file': 'fa fa-cloud-upload',
|
|
|
|
'rating': 'fa fa-star-half-o',
|
|
|
|
'link': 'fa fa-link',
|
|
|
|
'scale': 'fa fa-sliders',
|
|
|
|
'stripe': 'fa fa-credit-card',
|
|
|
|
'statement': 'fa fa-quote-left',
|
2015-08-06 05:52:59 +00:00
|
|
|
'yes_no': 'fa fa-toggle-on',
|
|
|
|
'number': 'fa fa-slack'
|
2015-08-07 21:02:44 +00:00
|
|
|
};
|
2015-07-04 03:25:25 +00:00
|
|
|
$scope.typeIcon = iconTypeMap[$scope.typeName];
|
2016-06-01 01:06:45 +00:00
|
|
|
}
|
2015-07-04 03:25:25 +00:00
|
|
|
};
|
2016-06-01 01:06:45 +00:00
|
|
|
});
|