2016-08-04 14:18:00 -04:00
|
|
|
(global => {
|
|
|
|
global.User = class {
|
|
|
|
constructor(opts) {
|
|
|
|
this.opts = opts;
|
2016-09-01 16:51:53 -04:00
|
|
|
this.placeProfileAvatarsToTop();
|
2016-08-04 14:18:00 -04:00
|
|
|
this.initTabs();
|
|
|
|
this.hideProjectLimitMessage();
|
|
|
|
}
|
|
|
|
|
2016-09-01 16:51:53 -04:00
|
|
|
placeProfileAvatarsToTop() {
|
2016-08-04 14:18:00 -04:00
|
|
|
$('.profile-groups-avatars').tooltip({
|
2016-09-01 07:54:10 -04:00
|
|
|
placement: 'top'
|
2016-08-04 14:18:00 -04:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
initTabs() {
|
|
|
|
return new UserTabs({
|
|
|
|
parentEl: '.user-profile',
|
|
|
|
action: this.opts.action
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
hideProjectLimitMessage() {
|
|
|
|
$('.hide-project-limit-message').on('click', e => {
|
2016-09-01 07:38:58 -04:00
|
|
|
e.preventDefault();
|
|
|
|
const path = gon.relative_url_root || '/';
|
2016-08-04 14:18:00 -04:00
|
|
|
$.cookie('hide_project_limit_message', 'false', {
|
|
|
|
path: path
|
|
|
|
});
|
|
|
|
$(this).parents('.project-limit-message').remove();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})(window.gl || (window.gl = {}));
|