gitlab-org--gitlab-foss/app/assets/javascripts/user.js
2017-03-22 03:07:27 -05:00

35 lines
876 B
JavaScript

/* eslint-disable class-methods-use-this, comma-dangle, arrow-parens, no-param-reassign */
import Cookies from 'js-cookie';
((global) => {
global.User = class {
constructor({ action }) {
this.action = action;
this.placeProfileAvatarsToTop();
this.initTabs();
this.hideProjectLimitMessage();
}
placeProfileAvatarsToTop() {
$('.profile-groups-avatars').tooltip({
placement: 'top'
});
}
initTabs() {
return new global.UserTabs({
parentEl: '.user-profile',
action: this.action
});
}
hideProjectLimitMessage() {
$('.hide-project-limit-message').on('click', e => {
e.preventDefault();
Cookies.set('hide_project_limit_message', 'false');
$(this).parents('.project-limit-message').remove();
});
}
};
})(window.gl || (window.gl = {}));