Commit 7ed0acd4 authored by Regis's avatar Regis

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
parent bceafa4e
(function() { (global => {
this.User = (function() { global.User = class {
function User(opts) { constructor(opts) {
this.opts = opts; this.opts = opts;
this.placeTop();
this.initTabs();
this.hideProjectLimitMessage();
}
placeTop() {
$('.profile-groups-avatars').tooltip({ $('.profile-groups-avatars').tooltip({
"placement": "top" "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() { initTabs() {
return new UserTabs({ return new UserTabs({
parentEl: '.user-profile', parentEl: '.user-profile',
action: this.opts.action action: this.opts.action
}); });
}; }
return User;
})();
}).call(this); 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 = {}));
...@@ -123,6 +123,6 @@ ...@@ -123,6 +123,6 @@
:javascript :javascript
var userProfile; var userProfile;
userProfile = new User({ userProfile = new gl.User({
action: "#{controller.action_name}" action: "#{controller.action_name}"
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment