diff options
Diffstat (limited to 'app')
-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(); }); |