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

35 lines
831 B
JavaScript
Raw Normal View History

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