2016-09-08 11:22:14 -04:00
|
|
|
((global) => {
|
2016-08-04 14:18:00 -04:00
|
|
|
global.User = class {
|
2016-09-09 10:57:13 -04:00
|
|
|
constructor({ action }) {
|
|
|
|
this.action = action;
|
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() {
|
2016-09-08 08:26:43 -04:00
|
|
|
return new global.UserTabs({
|
2016-08-04 14:18:00 -04:00
|
|
|
parentEl: '.user-profile',
|
2016-09-09 10:57:13 -04:00
|
|
|
action: this.action
|
2016-08-04 14:18:00 -04:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
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 = {}));
|