BigW Consortium Gitlab

group_avatar.js 745 Bytes
Newer Older
1
/* 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 */
Fatih Acet committed
2 3 4
(function() {
  this.GroupAvatar = (function() {
    function GroupAvatar() {
5
      $('.js-choose-group-avatar-button').on("click", function() {
Fatih Acet committed
6 7 8 9
        var form;
        form = $(this).closest("form");
        return form.find(".js-group-avatar-input").click();
      });
10
      $('.js-group-avatar-input').on("change", function() {
Fatih Acet committed
11 12 13 14 15 16 17 18 19
        var filename, form;
        form = $(this).closest("form");
        filename = $(this).val().replace(/^.*[\\\/]/, '');
        return form.find(".js-avatar-filename").text(filename);
      });
    }

    return GroupAvatar;
  })();
20
}).call(window);