1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-30 11:24:21 +01:00
fab-manager/app/assets/javascripts/directives/socialLink.js.erb

38 lines
1.1 KiB
Plaintext
Raw Normal View History

/* eslint-disable
no-return-assign,
no-undef,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
* 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: '='
},
templateUrl: '<%= asset_path "shared/_social_link.html" %>',
link (scope, element, attributes) {
if (scope.network === 'dailymotion') {
scope.image = "<%= asset_path('social/dailymotion.png') %>"
return scope.altText = 'd'
} else if (scope.network === 'echosciences') {
scope.image = "<%= asset_path('social/echosciences.png') %>"
return scope.altText = 'E)'
} else {
if (scope.network === 'website') {
return scope.faClass = 'fa-globe'
} else {
return scope.faClass = `fa-${scope.network.replace('_', '-')}`
}
}
}
})
])