BigW Consortium Gitlab

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

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

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

    hideProjectLimitMessage() {
      $('.hide-project-limit-message').on('click', e => {
25 26
        e.preventDefault();
        const path = gon.relative_url_root || '/';
27 28 29 30 31 32 33 34
        $.cookie('hide_project_limit_message', 'false', {
          path: path
        });
        $(this).parents('.project-limit-message').remove();
      });
    }
  }
})(window.gl || (window.gl = {}));