summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/group_avatar.js
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-10-23 16:05:53 +0300
committerFilipa Lacerda <filipa@gitlab.com>2017-10-23 16:05:53 +0300
commitc9045c00e669718acbb2894d402be958c150cfba (patch)
tree59c0f5a06cb88664b753b6ea1d29441896769a56 /app/assets/javascripts/group_avatar.js
parent9931ef4a8a9fa9544729fe39cb3572d278819c8d (diff)
downloadgitlab-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.js31
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);
+ });
+}