1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/app/assets/javascripts/directives/socialLink.coffee.erb
2016-05-18 09:11:08 +02:00

24 lines
678 B
Plaintext

Application.Directives.directive 'socialLink', [ ->
{
restrict: 'E'
scope:
network: '@?'
user: '='
templateUrl: '<%= asset_path "shared/_social_link.html" %>'
link: (scope, element, attributes) ->
if scope.network == 'dailymotion'
scope.image = "<%= asset_path('social/dailymotion.png') %>"
scope.altText = 'd'
else if scope.network == 'echosciences'
scope.image = "<%= asset_path('social/echosciences.png') %>"
scope.altText = 'E)'
else
if scope.network == 'website'
scope.faClass = 'fa-globe'
else
scope.faClass = 'fa-'+scope.network.replace('_', '-')
}
]