BigW Consortium Gitlab

user.js 876 Bytes
Newer Older
1
/* eslint-disable class-methods-use-this, comma-dangle, arrow-parens, no-param-reassign */
2 3

import Cookies from 'js-cookie';
4

5
((global) => {
6
  global.User = class {
7 8
    constructor({ action }) {
      this.action = action;
9
      this.placeProfileAvatarsToTop();
10 11 12 13
      this.initTabs();
      this.hideProjectLimitMessage();
    }

14
    placeProfileAvatarsToTop() {
15
      $('.profile-groups-avatars').tooltip({
Regis committed
16
        placement: 'top'
17 18 19 20
      });
    }

    initTabs() {
21
      return new global.UserTabs({
22
        parentEl: '.user-profile',
23
        action: this.action
24 25 26 27 28
      });
    }

    hideProjectLimitMessage() {
      $('.hide-project-limit-message').on('click', e => {
29
        e.preventDefault();
30
        Cookies.set('hide_project_limit_message', 'false');
31 32 33
        $(this).parents('.project-limit-message').remove();
      });
    }
34
  };
35
})(window.gl || (window.gl = {}));