BigW Consortium Gitlab

Commit 7ed0acd4 by 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() {
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);
(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 = {}));
......@@ -123,6 +123,6 @@
:javascript
var userProfile;
userProfile = new User({
userProfile = new gl.User({
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