2017-07-18 22:27:01 +00:00
|
|
|
import Cookies from 'js-cookie';
|
|
|
|
import UserTabs from './user_tabs';
|
2017-07-14 15:06:49 +00:00
|
|
|
|
2017-10-11 19:03:19 +00:00
|
|
|
function initUserProfile(action) {
|
2017-07-18 22:27:01 +00:00
|
|
|
// place profile avatars to top
|
|
|
|
$('.profile-groups-avatars').tooltip({
|
|
|
|
placement: 'top',
|
|
|
|
});
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new UserTabs({ parentEl: '.user-profile', action });
|
|
|
|
|
|
|
|
// hide project limit message
|
|
|
|
$('.hide-project-limit-message').on('click', (e) => {
|
|
|
|
e.preventDefault();
|
|
|
|
Cookies.set('hide_project_limit_message', 'false');
|
|
|
|
$(this).parents('.project-limit-message').remove();
|
|
|
|
});
|
|
|
|
}
|
2017-10-11 19:03:19 +00:00
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
const page = $('body').attr('data-page');
|
|
|
|
const action = page.split(':')[1];
|
|
|
|
initUserProfile(action);
|
|
|
|
});
|