debian-mirror-gitlab/app/assets/javascripts/pages/users/index.js

29 lines
818 B
JavaScript
Raw Normal View History

2018-05-09 12:01:36 +05:30
import $ from 'jquery';
2018-03-27 19:54:05 +05:30
import UserCallout from '~/user_callout';
2017-09-10 17:25:29 +05:30
import Cookies from 'js-cookie';
import UserTabs from './user_tabs';
2018-03-17 18:26:18 +05:30
function initUserProfile(action) {
2017-09-10 17:25:29 +05:30
// 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();
});
}
2018-03-17 18:26:18 +05:30
document.addEventListener('DOMContentLoaded', () => {
const page = $('body').attr('data-page');
const action = page.split(':')[1];
initUserProfile(action);
2018-03-27 19:54:05 +05:30
new UserCallout(); // eslint-disable-line no-new
2018-03-17 18:26:18 +05:30
});