ensure dispatcher is run before other DOMContentLoaded handlers
This commit is contained in:
parent
053c3d0e1b
commit
f0fe736e32
|
@ -12,9 +12,9 @@ import ShortcutsIssuable from './shortcuts_issuable';
|
||||||
import Diff from './diff';
|
import Diff from './diff';
|
||||||
import SearchAutocomplete from './search_autocomplete';
|
import SearchAutocomplete from './search_autocomplete';
|
||||||
|
|
||||||
(function() {
|
var Dispatcher;
|
||||||
var Dispatcher;
|
|
||||||
|
|
||||||
|
(function() {
|
||||||
Dispatcher = (function() {
|
Dispatcher = (function() {
|
||||||
function Dispatcher() {
|
function Dispatcher() {
|
||||||
this.initSearch();
|
this.initSearch();
|
||||||
|
@ -629,8 +629,8 @@ import SearchAutocomplete from './search_autocomplete';
|
||||||
|
|
||||||
return Dispatcher;
|
return Dispatcher;
|
||||||
})();
|
})();
|
||||||
|
})();
|
||||||
|
|
||||||
$(window).on('load', function() {
|
export default function initDispatcher() {
|
||||||
new Dispatcher();
|
return new Dispatcher();
|
||||||
});
|
}
|
||||||
}).call(window);
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ import './projects_dropdown';
|
||||||
import './render_gfm';
|
import './render_gfm';
|
||||||
import initBreadcrumbs from './breadcrumb';
|
import initBreadcrumbs from './breadcrumb';
|
||||||
|
|
||||||
import './dispatcher';
|
import initDispatcher from './dispatcher';
|
||||||
|
|
||||||
// eslint-disable-next-line global-require, import/no-commonjs
|
// eslint-disable-next-line global-require, import/no-commonjs
|
||||||
if (process.env.NODE_ENV !== 'production') require('./test_utils/');
|
if (process.env.NODE_ENV !== 'production') require('./test_utils/');
|
||||||
|
@ -265,4 +265,6 @@ $(() => {
|
||||||
removeFlashClickListener(flashEl);
|
removeFlashClickListener(flashEl);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initDispatcher();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue