diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-02-07 18:02:49 +0000 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-02-07 18:33:00 +0000 |
commit | df469864b1ab1e0bfaa1e843d3d0a84042604646 (patch) | |
tree | 81a59a012180c8e2c43f8573a50d5ddec26040ab /app/assets/javascripts/user.js | |
parent | bc13687c7e374116e4830d004b82e9960d3a55cc (diff) | |
download | gitlab-ce-update-filenames-regex.tar.gz |
Updated the filename regexupdate-filenames-regex
Diffstat (limited to 'app/assets/javascripts/user.js')
-rw-r--r-- | app/assets/javascripts/user.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/app/assets/javascripts/user.js b/app/assets/javascripts/user.js new file mode 100644 index 00000000000..059e6c628b3 --- /dev/null +++ b/app/assets/javascripts/user.js @@ -0,0 +1,34 @@ +/* eslint-disable class-methods-use-this, comma-dangle, arrow-parens, no-param-reassign */ +/* global Cookies */ + +((global) => { + global.User = class { + constructor({ action }) { + this.action = action; + this.placeProfileAvatarsToTop(); + this.initTabs(); + this.hideProjectLimitMessage(); + } + + placeProfileAvatarsToTop() { + $('.profile-groups-avatars').tooltip({ + placement: 'top' + }); + } + + initTabs() { + return new global.UserTabs({ + parentEl: '.user-profile', + action: this.action + }); + } + + hideProjectLimitMessage() { + $('.hide-project-limit-message').on('click', e => { + e.preventDefault(); + Cookies.set('hide_project_limit_message', 'false'); + $(this).parents('.project-limit-message').remove(); + }); + } + }; +})(window.gl || (window.gl = {})); |