summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/user.js.es6
blob: e064853202db540a0b0048c461230c3a44a3dcac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
window.gl = window.gl || {};

((global) => {
  class User {
    constructor(opts) {
      this.opts = opts;
      $('.profile-groups-avatars').tooltip({
        "placement": "top"
      });
      this.initTabs();
      $('.hide-project-limit-message').on('click', function(e) {
        const path = '/';
        $.cookie('hide_project_limit_message', 'false', {
          path: path
        });
        $(this).parents('.project-limit-message').remove();
        e.preventDefault();
        return;
      });
    }

    initTabs() {
      return new UserTabs({
        parentEl: '.user-profile',
        action: this.opts.action
      });
    }
  }

  global.User = User;
})(window.gl);