refactor UserTabs class to ES module syntax
This commit is contained in:
parent
24c2739be9
commit
d30e66c9a8
|
@ -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/');
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* 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;
|
||||
|
|
Loading…
Reference in New Issue