2017-01-10 17:54:56 -05:00
|
|
|
/* eslint-disable class-methods-use-this, comma-dangle, arrow-parens, no-param-reassign */
|
2017-03-11 01:45:34 -05:00
|
|
|
|
|
|
|
import Cookies from 'js-cookie';
|
2016-12-13 22:01:05 -05:00
|
|
|
|
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();
|
2016-10-24 17:54:38 -04:00
|
|
|
Cookies.set('hide_project_limit_message', 'false');
|
2016-08-04 14:18:00 -04:00
|
|
|
$(this).parents('.project-limit-message').remove();
|
|
|
|
});
|
|
|
|
}
|
2017-01-10 17:54:56 -05:00
|
|
|
};
|
2016-08-04 14:18:00 -04:00
|
|
|
})(window.gl || (window.gl = {}));
|