Skip to content
Snippets Groups Projects
Commit d30e66c9 authored by Mike Greiling's avatar Mike Greiling
Browse files

refactor UserTabs class to ES module syntax

parent 24c2739b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -156,7 +156,6 @@ import './todos';
import './tree';
import './usage_ping';
import './user';
import './user_tabs';
 
// eslint-disable-next-line global-require, import/no-commonjs
if (process.env.NODE_ENV !== 'production') require('./test_utils/');
Loading
Loading
/* eslint-disable class-methods-use-this, comma-dangle, arrow-parens, no-param-reassign */
 
import Cookies from 'js-cookie';
import UserTabs from './user_tabs';
 
class User {
constructor({ action }) {
Loading
Loading
@@ -17,7 +18,7 @@ class User {
}
 
initTabs() {
return new window.gl.UserTabs({
return new UserTabs({
parentEl: '.user-profile',
action: this.action
});
Loading
Loading
Loading
Loading
@@ -60,7 +60,7 @@ content on the Users#show page.
</div>
*/
 
class UserTabs {
export default class UserTabs {
constructor ({ defaultAction, action, parentEl }) {
this.loaded = {};
this.defaultAction = defaultAction || 'activity';
Loading
Loading
@@ -171,6 +171,3 @@ class UserTabs {
return this.$parentEl.find('.nav-links .active a').data('action');
}
}
window.gl = window.gl || {};
window.gl.UserTabs = UserTabs;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment