summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-06-30 18:12:24 -0500
committerMike Greiling <mike@pixelcog.com>2017-07-06 10:10:03 -0500
commit12efe4946f342216c411f070a3aa1420073a3e20 (patch)
tree33f85a71216991fd8dc323d8fe430b2922959b07 /app/assets
parentd30e66c9a88af6735fcce837ca701096e9582942 (diff)
downloadgitlab-ce-12efe4946f342216c411f070a3aa1420073a3e20.tar.gz
refactor UsagePing class to ES module syntax
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/dispatcher.js3
-rw-r--r--app/assets/javascripts/main.js1
-rw-r--r--app/assets/javascripts/usage_ping.js5
3 files changed, 3 insertions, 6 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js
index d73433beac1..8d805fc0c1a 100644
--- a/app/assets/javascripts/dispatcher.js
+++ b/app/assets/javascripts/dispatcher.js
@@ -52,6 +52,7 @@ import UsersSelect from './users_select';
import RefSelectDropdown from './ref_select_dropdown';
import GfmAutoComplete from './gfm_auto_complete';
import ShortcutsBlob from './shortcuts_blob';
+import UsagePing from './usage_ping';
import UsernameValidator from './username_validator';
import VersionCheckImage from './version_check_image';
import Wikis from './wikis';
@@ -433,7 +434,7 @@ import OAuthRememberMe from './oauth_remember_me';
new Admin();
switch (path[1]) {
case 'cohorts':
- new gl.UsagePing();
+ new UsagePing();
break;
case 'groups':
new UsersSelect();
diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js
index 35bdd167236..8a90aaf9336 100644
--- a/app/assets/javascripts/main.js
+++ b/app/assets/javascripts/main.js
@@ -154,7 +154,6 @@ import './syntax_highlight';
import './task_list';
import './todos';
import './tree';
-import './usage_ping';
import './user';
// eslint-disable-next-line global-require, import/no-commonjs
diff --git a/app/assets/javascripts/usage_ping.js b/app/assets/javascripts/usage_ping.js
index fd3af7d7ab6..2389056bd02 100644
--- a/app/assets/javascripts/usage_ping.js
+++ b/app/assets/javascripts/usage_ping.js
@@ -1,4 +1,4 @@
-function UsagePing() {
+export default function UsagePing() {
const usageDataUrl = $('.usage-data').data('endpoint');
$.ajax({
@@ -10,6 +10,3 @@ function UsagePing() {
},
});
}
-
-window.gl = window.gl || {};
-window.gl.UsagePing = UsagePing;