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();
|
|
|
|
const path = gon.relative_url_root || '/';
|
2016-08-04 18:18:00 +00:00
|
|
|
$.cookie('hide_project_limit_message', 'false', {
|
|
|
|
path: path
|
|
|
|
});
|
|
|
|
$(this).parents('.project-limit-message').remove();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})(window.gl || (window.gl = {}));
|