summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-06-30 17:48:54 -0500
committerMike Greiling <mike@pixelcog.com>2017-07-06 10:10:03 -0500
commitd30e66c9a88af6735fcce837ca701096e9582942 (patch)
treec1851b86458d5ce1759bc15394cfbf458959b9b2
parent24c2739be9559e8d211672f1718669b7e6c5eb6d (diff)
downloadgitlab-ce-d30e66c9a88af6735fcce837ca701096e9582942.tar.gz
refactor UserTabs class to ES module syntax
-rw-r--r--app/assets/javascripts/main.js1
-rw-r--r--app/assets/javascripts/user.js3
-rw-r--r--app/assets/javascripts/user_tabs.js5
3 files changed, 3 insertions, 6 deletions
diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js
index ab56c8ea69f..35bdd167236 100644
--- a/app/assets/javascripts/main.js
+++ b/app/assets/javascripts/main.js
@@ -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/');
diff --git a/app/assets/javascripts/user.js b/app/assets/javascripts/user.js
index 3ab9ef5408e..9ef94ac7616 100644
--- a/app/assets/javascripts/user.js
+++ b/app/assets/javascripts/user.js
@@ -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
});
diff --git a/app/assets/javascripts/user_tabs.js b/app/assets/javascripts/user_tabs.js
index be70f4cb4e2..f8e23c8624d 100644
--- a/app/assets/javascripts/user_tabs.js
+++ b/app/assets/javascripts/user_tabs.js
@@ -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;