diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-02-01 21:28:50 -0600 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-02-01 21:28:50 -0600 |
commit | f0fe736e322377ee15859bbb2a21fb0de4c5d2fd (patch) | |
tree | 1a3d35aab7ad9ef2147a8f0f1c8f8da2e2bb9c92 | |
parent | 053c3d0e1ba4a6bb8cdf099b4a0a3eeef919cd62 (diff) | |
download | gitlab-ce-f0fe736e322377ee15859bbb2a21fb0de4c5d2fd.tar.gz |
ensure dispatcher is run before other DOMContentLoaded handlers
-rw-r--r-- | app/assets/javascripts/dispatcher.js | 12 | ||||
-rw-r--r-- | app/assets/javascripts/main.js | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index ba54ff8ccb5..242c1c06a33 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -12,9 +12,9 @@ import ShortcutsIssuable from './shortcuts_issuable'; import Diff from './diff'; import SearchAutocomplete from './search_autocomplete'; -(function() { - var Dispatcher; +var Dispatcher; +(function() { Dispatcher = (function() { function Dispatcher() { this.initSearch(); @@ -629,8 +629,8 @@ import SearchAutocomplete from './search_autocomplete'; return Dispatcher; })(); +})(); - $(window).on('load', function() { - new Dispatcher(); - }); -}).call(window); +export default function initDispatcher() { + return new Dispatcher(); +} diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index d8b881a8fac..39445a85c77 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -33,7 +33,7 @@ import './projects_dropdown'; import './render_gfm'; import initBreadcrumbs from './breadcrumb'; -import './dispatcher'; +import initDispatcher from './dispatcher'; // eslint-disable-next-line global-require, import/no-commonjs if (process.env.NODE_ENV !== 'production') require('./test_utils/'); @@ -265,4 +265,6 @@ $(() => { removeFlashClickListener(flashEl); }); } + + initDispatcher(); }); |