Commit c7afb8f8 authored by Mike Greiling's avatar Mike Greiling

Move initFieldErrors from dispatcher to main.js

parent 105ab36b
......@@ -3,7 +3,6 @@
import $ from 'jquery';
import GfmAutoComplete from './gfm_auto_complete';
import { convertPermissionToBoolean } from './lib/utils/common_utils';
import GlFieldErrors from './gl_field_errors';
import Shortcuts from './shortcuts';
import SearchAutocomplete from './search_autocomplete';
import performanceBar from './performance_bar';
......@@ -15,12 +14,6 @@ function initSearch() {
}
}
function initFieldErrors() {
$('.gl-show-field-errors').each((i, form) => {
new GlFieldErrors(form);
});
}
function initPageShortcuts(page) {
const pagesWithCustomShortcuts = [
'projects:activity',
......@@ -78,7 +71,6 @@ function initPerformanceBar() {
export default () => {
initSearch();
initFieldErrors();
const page = $('body').attr('data-page');
if (page) {
......
......@@ -28,6 +28,7 @@ import './frequent_items';
import initBreadcrumbs from './breadcrumb';
import initDispatcher from './dispatcher';
import initUsagePingConsent from './usage_ping_consent';
import GlFieldErrors from './gl_field_errors';
// expose jQuery as global (TODO: remove these)
window.jQuery = jQuery;
......@@ -266,5 +267,8 @@ document.addEventListener('DOMContentLoaded', () => {
});
}
// initialize field errors
$('.gl-show-field-errors').each((i, form) => new GlFieldErrors(form));
initDispatcher();
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment