debian-mirror-gitlab/app/assets/javascripts/user.js

36 lines
876 B
JavaScript
Raw Normal View History

2017-08-17 22:00:37 +05:30
/* eslint-disable class-methods-use-this, comma-dangle, arrow-parens, no-param-reassign */
import Cookies from 'js-cookie';
2016-11-03 12:29:30 +05:30
((global) => {
2016-09-29 09:46:39 +05:30
global.User = class {
2016-11-03 12:29:30 +05:30
constructor({ action }) {
this.action = action;
2016-09-29 09:46:39 +05:30
this.placeProfileAvatarsToTop();
this.initTabs();
this.hideProjectLimitMessage();
}
placeProfileAvatarsToTop() {
$('.profile-groups-avatars').tooltip({
placement: 'top'
});
}
initTabs() {
2016-11-03 12:29:30 +05:30
return new global.UserTabs({
2016-09-29 09:46:39 +05:30
parentEl: '.user-profile',
2016-11-03 12:29:30 +05:30
action: this.action
2016-09-29 09:46:39 +05:30
});
}
hideProjectLimitMessage() {
$('.hide-project-limit-message').on('click', e => {
e.preventDefault();
2017-08-17 22:00:37 +05:30
Cookies.set('hide_project_limit_message', 'false');
2016-09-29 09:46:39 +05:30
$(this).parents('.project-limit-message').remove();
});
}
2017-08-17 22:00:37 +05:30
};
2016-09-29 09:46:39 +05:30
})(window.gl || (window.gl = {}));