2018-10-25 16:51:20 +02:00
|
|
|
/* eslint-disable
|
|
|
|
no-return-assign,
|
|
|
|
no-undef,
|
|
|
|
*/
|
|
|
|
// TODO: This file was created by bulk-decaffeinate.
|
|
|
|
// Fix any style issues and re-enable lint.
|
2018-10-25 16:50:16 +02:00
|
|
|
/*
|
|
|
|
* decaffeinate suggestions:
|
|
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
|
|
*/
|
|
|
|
Application.Directives.directive('socialLink', [ () =>
|
|
|
|
({
|
|
|
|
restrict: 'E',
|
|
|
|
scope: {
|
|
|
|
network: '@?',
|
2016-05-17 16:41:32 +02:00
|
|
|
user: '='
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
|
|
|
templateUrl: '<%= asset_path "shared/_social_link.html" %>',
|
2018-10-25 16:51:20 +02:00
|
|
|
link (scope, element, attributes) {
|
2018-10-25 16:50:16 +02:00
|
|
|
if (scope.network === 'dailymotion') {
|
2018-10-25 16:51:20 +02:00
|
|
|
scope.image = "<%= asset_path('social/dailymotion.png') %>"
|
|
|
|
return scope.altText = 'd'
|
2018-10-25 16:50:16 +02:00
|
|
|
} else if (scope.network === 'echosciences') {
|
2018-10-25 16:51:20 +02:00
|
|
|
scope.image = "<%= asset_path('social/echosciences.png') %>"
|
|
|
|
return scope.altText = 'E)'
|
2018-10-25 16:50:16 +02:00
|
|
|
} else {
|
|
|
|
if (scope.network === 'website') {
|
2018-10-25 16:51:20 +02:00
|
|
|
return scope.faClass = 'fa-globe'
|
2018-10-25 16:50:16 +02:00
|
|
|
} else {
|
2018-10-25 16:51:20 +02:00
|
|
|
return scope.faClass = `fa-${scope.network.replace('_', '-')}`
|
2018-10-25 16:50:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2018-10-25 16:51:20 +02:00
|
|
|
])
|