gitlab-org--gitlab-foss/app/assets/javascripts/users/user.js

35 lines
765 B
JavaScript
Raw Normal View History

2017-07-14 11:06:49 -04:00
/* eslint-disable class-methods-use-this */
2017-03-11 01:45:34 -05:00
import Cookies from 'js-cookie';
import UserTabs from './user_tabs';
2017-07-14 11:06:49 -04:00
export default class User {
constructor({ action }) {
this.action = action;
this.placeProfileAvatarsToTop();
this.initTabs();
this.hideProjectLimitMessage();
}
placeProfileAvatarsToTop() {
$('.profile-groups-avatars').tooltip({
2017-07-14 11:06:49 -04:00
placement: 'top',
});
}
initTabs() {
return new UserTabs({
parentEl: '.user-profile',
2017-07-14 11:06:49 -04:00
action: this.action,
});
}
hideProjectLimitMessage() {
2017-07-14 11:06:49 -04:00
$('.hide-project-limit-message').on('click', (e) => {
e.preventDefault();
Cookies.set('hide_project_limit_message', 'false');
$(this).parents('.project-limit-message').remove();
});
}
}