BigW Consortium Gitlab

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

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

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

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

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