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

24 lines
678 B
Plaintext
Raw Normal View History

2016-05-17 16:41:32 +02:00
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('_', '-')
2016-05-17 16:41:32 +02:00
}
]