summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorRegis <boudinot.regis@yahoo.com>2016-08-04 12:18:00 -0600
committerRegis <boudinot.regis@yahoo.com>2016-08-25 17:27:20 -0600
commit7ed0acd422a95c4cbb1406f67929a5da669f2681 (patch)
tree7a08568809dc705c7b190873091cdac0484366f9 /app/assets/javascripts
parentbceafa4e8eb7141771bb759fc9b4d625794f784a (diff)
downloadgitlab-ce-7ed0acd422a95c4cbb1406f67929a5da669f2681.tar.gz
turned ES5 users.js to ES6 users.js.es6 for babel
added semicolons remove users.js rename users to user in filename removed uneeded semi-colons and returning null in constructor class is wrapped - a lot of builds will fail formatting replaced 'new User' with 'new gl.User' in app/users/show.html.haml window.gl || window.gl = {} - seeing if rspec9/spinach6/spinach9 will pass putting window logic before IIFE Fixed typo in users show view - extracted jquery calls in constructor to prototype methods fixed window declaration in IIFE argument adding new line
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/user.js29
-rw-r--r--app/assets/javascripts/user.js.es635
2 files changed, 35 insertions, 29 deletions
diff --git a/app/assets/javascripts/user.js b/app/assets/javascripts/user.js
deleted file mode 100644
index 6c4d88cf407..00000000000
--- a/app/assets/javascripts/user.js
+++ /dev/null
@@ -1,29 +0,0 @@
-(function() {
- this.User = (function() {
- function User(opts) {
- this.opts = opts;
- $('.profile-groups-avatars').tooltip({
- "placement": "top"
- });
- this.initTabs();
- $('.hide-project-limit-message').on('click', function(e) {
- $.cookie('hide_project_limit_message', 'false', {
- path: gon.relative_url_root || '/'
- });
- $(this).parents('.project-limit-message').remove();
- return e.preventDefault();
- });
- }
-
- User.prototype.initTabs = function() {
- return new UserTabs({
- parentEl: '.user-profile',
- action: this.opts.action
- });
- };
-
- return User;
-
- })();
-
-}).call(this);
diff --git a/app/assets/javascripts/user.js.es6 b/app/assets/javascripts/user.js.es6
new file mode 100644
index 00000000000..c934afa458a
--- /dev/null
+++ b/app/assets/javascripts/user.js.es6
@@ -0,0 +1,35 @@
+(global => {
+ global.User = class {
+ constructor(opts) {
+ this.opts = opts;
+ this.placeTop();
+ this.initTabs();
+ this.hideProjectLimitMessage();
+ }
+
+ placeTop() {
+ $('.profile-groups-avatars').tooltip({
+ "placement": "top"
+ });
+ }
+
+ initTabs() {
+ return new UserTabs({
+ parentEl: '.user-profile',
+ action: this.opts.action
+ });
+ }
+
+ hideProjectLimitMessage() {
+ $('.hide-project-limit-message').on('click', e => {
+ const path = '/';
+ $.cookie('hide_project_limit_message', 'false', {
+ path: path
+ });
+ $(this).parents('.project-limit-message').remove();
+ e.preventDefault();
+ return;
+ });
+ }
+ }
+})(window.gl || (window.gl = {}));