summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pages/users/show/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/pages/users/show/index.js')
-rw-r--r--app/assets/javascripts/pages/users/show/index.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/app/assets/javascripts/pages/users/show/index.js b/app/assets/javascripts/pages/users/show/index.js
index f18f98b4e9a..cc030100944 100644
--- a/app/assets/javascripts/pages/users/show/index.js
+++ b/app/assets/javascripts/pages/users/show/index.js
@@ -1,3 +1,27 @@
import UserCallout from '~/user_callout';
+import Cookies from 'js-cookie';
+import UserTabs from '../../../users/user_tabs';
-export default () => new UserCallout();
+const initUserProfile = (action) => {
+ // 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();
+ });
+};
+
+export default () => {
+ const page = $('body').attr('data-page');
+ const action = page.split(':')[1];
+ initUserProfile(action);
+ new UserCallout(); // eslint-disable-line no-new
+};