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
2018-11-21 11:08:53 +01:00

37 lines
1.1 KiB
Plaintext

/* 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', [ function () {
return ({
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') %>";
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('_', '-')}`;
}
}
}
});
}]);