diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-11-13 20:45:45 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-11-13 20:45:45 +0300 |
commit | 86cc493d76014e2db96d3f3be596dd9462b78487 (patch) | |
tree | e4458db53c094779c223568deaac2daa1ecf6905 /app/assets/javascripts/project_avatar.js | |
parent | c8d594e04e2d12a1c0d68ed80998f0b42f0fc8c5 (diff) |
Export project, projectAvatar and projectImport as ES6 modules
Diffstat (limited to 'app/assets/javascripts/project_avatar.js')
-rw-r--r-- | app/assets/javascripts/project_avatar.js | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/app/assets/javascripts/project_avatar.js b/app/assets/javascripts/project_avatar.js index aabdfbf65e2..56627aa155c 100644 --- a/app/assets/javascripts/project_avatar.js +++ b/app/assets/javascripts/project_avatar.js @@ -1,20 +1,13 @@ -/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, one-var, one-var-declaration-per-line, no-useless-escape, max-len */ -(function() { - this.ProjectAvatar = (function() { - function ProjectAvatar() { - $('.js-choose-project-avatar-button').bind('click', function() { - var form; - form = $(this).closest('form'); - return form.find('.js-project-avatar-input').click(); - }); - $('.js-project-avatar-input').bind('change', function() { - var filename, form; - form = $(this).closest('form'); - filename = $(this).val().replace(/^.*[\\\/]/, ''); - return form.find('.js-avatar-filename').text(filename); - }); - } +export default function projectAvatar() { + $('.js-choose-project-avatar-button').bind('click', function onClickAvatar() { + const form = $(this).closest('form'); + return form.find('.js-project-avatar-input').click(); + }); - return ProjectAvatar; - })(); -}).call(window); + $('.js-project-avatar-input').bind('change', function onClickAvatarInput() { + const form = $(this).closest('form'); + // eslint-disable-next-line no-useless-escape + const filename = $(this).val().replace(/^.*[\\\/]/, ''); + return form.find('.js-avatar-filename').text(filename); + }); +} |