summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/network
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-03-03 18:21:39 -0600
committerMike Greiling <mike@pixelcog.com>2017-03-05 14:25:40 -0600
commitb7bf9b41b014d1c3f895f075a20f98e1dc229b0c (patch)
tree583d13e1c42c1f53c60062dc5cf064a2f64777ef /app/assets/javascripts/network
parent34742710099382b08dabb060fb4cd14000d8680a (diff)
downloadgitlab-ce-b7bf9b41b014d1c3f895f075a20f98e1dc229b0c.tar.gz
refactor Network class
Diffstat (limited to 'app/assets/javascripts/network')
-rw-r--r--app/assets/javascripts/network/network.js30
-rw-r--r--app/assets/javascripts/network/network_bundle.js3
2 files changed, 15 insertions, 18 deletions
diff --git a/app/assets/javascripts/network/network.js b/app/assets/javascripts/network/network.js
index 845d351c547..a3fd22aff2a 100644
--- a/app/assets/javascripts/network/network.js
+++ b/app/assets/javascripts/network/network.js
@@ -2,20 +2,18 @@
import BranchGraph from './branch_graph';
-(function() {
- this.Network = (function() {
- function Network(opts) {
- var vph;
- $("#filter_ref").click(function() {
- return $(this).closest('form').submit();
- });
- this.branch_graph = new BranchGraph($(".network-graph"), opts);
- vph = $(window).height() - 250;
- $('.network-graph').css({
- 'height': vph + 'px'
- });
- }
+export default (function() {
+ function Network(opts) {
+ var vph;
+ $("#filter_ref").click(function() {
+ return $(this).closest('form').submit();
+ });
+ this.branch_graph = new BranchGraph($(".network-graph"), opts);
+ vph = $(window).height() - 250;
+ $('.network-graph').css({
+ 'height': vph + 'px'
+ });
+ }
- return Network;
- })();
-}).call(window);
+ return Network;
+})();
diff --git a/app/assets/javascripts/network/network_bundle.js b/app/assets/javascripts/network/network_bundle.js
index d0ce2886842..c35b81dbf0c 100644
--- a/app/assets/javascripts/network/network_bundle.js
+++ b/app/assets/javascripts/network/network_bundle.js
@@ -1,8 +1,7 @@
/* eslint-disable func-names, space-before-function-paren, prefer-arrow-callback, quotes, no-var, vars-on-top, camelcase, comma-dangle, consistent-return, max-len */
-/* global Network */
/* global ShortcutsNetwork */
-require('./network');
+import Network from './network';
(function() {
$(function() {