2017-01-10 22:54:56 +00:00
|
|
|
/* eslint-disable class-methods-use-this, comma-dangle, arrow-parens, no-param-reassign */
|
2016-12-14 03:01:05 +00:00
|
|
|
/* global Cookies */
|
|
|
|
|
2016-09-08 15:22:14 +00:00
|
|
|
((global) => {
|
2016-08-04 18:18:00 +00:00
|
|
|
global.User = class {
|
2016-09-09 14:57:13 +00:00
|
|
|
constructor({ action }) {
|
|
|
|
this.action = action;
|
2016-09-01 20:51:53 +00:00
|
|
|
this.placeProfileAvatarsToTop();
|
2016-08-04 18:18:00 +00:00
|
|
|
this.initTabs();
|
|
|
|
this.hideProjectLimitMessage();
|
|
|
|
}
|
|
|
|
|
2016-09-01 20:51:53 +00:00
|
|
|
placeProfileAvatarsToTop() {
|
2016-08-04 18:18:00 +00:00
|
|
|
$('.profile-groups-avatars').tooltip({
|
2016-09-01 11:54:10 +00:00
|
|
|
placement: 'top'
|
2016-08-04 18:18:00 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
initTabs() {
|
2016-09-08 12:26:43 +00:00
|
|
|
return new global.UserTabs({
|
2016-08-04 18:18:00 +00:00
|
|
|
parentEl: '.user-profile',
|
2016-09-09 14:57:13 +00:00
|
|
|
action: this.action
|
2016-08-04 18:18:00 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
hideProjectLimitMessage() {
|
|
|
|
$('.hide-project-limit-message').on('click', e => {
|
2016-09-01 11:38:58 +00:00
|
|
|
e.preventDefault();
|
2016-10-24 21:54:38 +00:00
|
|
|
Cookies.set('hide_project_limit_message', 'false');
|
2016-08-04 18:18:00 +00:00
|
|
|
$(this).parents('.project-limit-message').remove();
|
|
|
|
});
|
|
|
|
}
|
2017-01-10 22:54:56 +00:00
|
|
|
};
|
2016-08-04 18:18:00 +00:00
|
|
|
})(window.gl || (window.gl = {}));
|