diff options
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/dispatcher.js | 7 | ||||
-rw-r--r-- | app/assets/javascripts/pages/users/show/index.js | 26 | ||||
-rw-r--r-- | app/assets/javascripts/users/index.js | 25 |
3 files changed, 29 insertions, 29 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index e3d30442339..86de8a9418c 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -463,12 +463,13 @@ var Dispatcher; .catch(fail); break; case 'users:show': + case 'users:groups': + case 'users:contributed': + case 'users:projects': + case 'users:snippets': import('./pages/users/show') .then(callDefault) .catch(fail); - import('./users') - .then(callDefault) - .catch(fail); break; case 'admin:conversational_development_index:show': import('./pages/admin/conversational_development_index/show') 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 +}; diff --git a/app/assets/javascripts/users/index.js b/app/assets/javascripts/users/index.js deleted file mode 100644 index 687f4de377c..00000000000 --- a/app/assets/javascripts/users/index.js +++ /dev/null @@ -1,25 +0,0 @@ -import Cookies from 'js-cookie'; -import UserTabs from './user_tabs'; - -function 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); -}; |