Commit d30e66c9 authored by Mike Greiling's avatar Mike Greiling

refactor UserTabs class to ES module syntax

parent 24c2739b
......@@ -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/');
......
/* 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 }) {
......@@ -17,7 +18,7 @@ class User {
}
initTabs() {
return new window.gl.UserTabs({
return new UserTabs({
parentEl: '.user-profile',
action: this.action
});
......
......@@ -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';
......@@ -171,6 +171,3 @@ class UserTabs {
return this.$parentEl.find('.nav-links .active a').data('action');
}
}
window.gl = window.gl || {};
window.gl.UserTabs = UserTabs;
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