BigW Consortium Gitlab

user.js.es6 770 Bytes
Newer Older
1
/* eslint-disable */
2
((global) => {
3
  global.User = class {
4 5
    constructor({ action }) {
      this.action = action;
6
      this.placeProfileAvatarsToTop();
7 8 9 10
      this.initTabs();
      this.hideProjectLimitMessage();
    }

11
    placeProfileAvatarsToTop() {
12
      $('.profile-groups-avatars').tooltip({
Regis committed
13
        placement: 'top'
14 15 16 17
      });
    }

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

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