diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-10-23 16:05:53 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-10-23 16:05:53 +0300 |
commit | c9045c00e669718acbb2894d402be958c150cfba (patch) | |
tree | 59c0f5a06cb88664b753b6ea1d29441896769a56 /app/assets/javascripts/group_avatar.js | |
parent | 9931ef4a8a9fa9544729fe39cb3572d278819c8d (diff) | |
download | gitlab-ce-c9045c00e669718acbb2894d402be958c150cfba.tar.gz |
Removes group_avatar & group_label_subscription from global namespace
Diffstat (limited to 'app/assets/javascripts/group_avatar.js')
-rw-r--r-- | app/assets/javascripts/group_avatar.js | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/app/assets/javascripts/group_avatar.js b/app/assets/javascripts/group_avatar.js index f03b47b1c1d..2168ff3a8ba 100644 --- a/app/assets/javascripts/group_avatar.js +++ b/app/assets/javascripts/group_avatar.js @@ -1,19 +1,12 @@ -/* eslint-disable func-names, space-before-function-paren, wrap-iife, quotes, no-var, one-var, one-var-declaration-per-line, no-useless-escape, max-len */ - -window.GroupAvatar = (function() { - function GroupAvatar() { - $('.js-choose-group-avatar-button').on("click", function() { - var form; - form = $(this).closest("form"); - return form.find(".js-group-avatar-input").click(); - }); - $('.js-group-avatar-input').on("change", function() { - var filename, form; - form = $(this).closest("form"); - filename = $(this).val().replace(/^.*[\\\/]/, ''); - return form.find(".js-avatar-filename").text(filename); - }); - } - - return GroupAvatar; -})(); +export default function groupAvatar() { + $('.js-choose-group-avatar-button').on('click', function onClickGroupAvatar() { + const form = $(this).closest('form'); + return form.find('.js-group-avatar-input').click(); + }); + $('.js-group-avatar-input').on('change', function onChangeAvatarInput() { + 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); + }); +} |