Commit c7afb8f8 authored by Mike Greiling's avatar Mike Greiling

Move initFieldErrors from dispatcher to main.js

parent 105ab36b
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
import $ from 'jquery'; import $ from 'jquery';
import GfmAutoComplete from './gfm_auto_complete'; import GfmAutoComplete from './gfm_auto_complete';
import { convertPermissionToBoolean } from './lib/utils/common_utils'; import { convertPermissionToBoolean } from './lib/utils/common_utils';
import GlFieldErrors from './gl_field_errors';
import Shortcuts from './shortcuts'; import Shortcuts from './shortcuts';
import SearchAutocomplete from './search_autocomplete'; import SearchAutocomplete from './search_autocomplete';
import performanceBar from './performance_bar'; import performanceBar from './performance_bar';
...@@ -15,12 +14,6 @@ function initSearch() { ...@@ -15,12 +14,6 @@ function initSearch() {
} }
} }
function initFieldErrors() {
$('.gl-show-field-errors').each((i, form) => {
new GlFieldErrors(form);
});
}
function initPageShortcuts(page) { function initPageShortcuts(page) {
const pagesWithCustomShortcuts = [ const pagesWithCustomShortcuts = [
'projects:activity', 'projects:activity',
...@@ -78,7 +71,6 @@ function initPerformanceBar() { ...@@ -78,7 +71,6 @@ function initPerformanceBar() {
export default () => { export default () => {
initSearch(); initSearch();
initFieldErrors();
const page = $('body').attr('data-page'); const page = $('body').attr('data-page');
if (page) { if (page) {
......
...@@ -28,6 +28,7 @@ import './frequent_items'; ...@@ -28,6 +28,7 @@ import './frequent_items';
import initBreadcrumbs from './breadcrumb'; import initBreadcrumbs from './breadcrumb';
import initDispatcher from './dispatcher'; import initDispatcher from './dispatcher';
import initUsagePingConsent from './usage_ping_consent'; import initUsagePingConsent from './usage_ping_consent';
import GlFieldErrors from './gl_field_errors';
// expose jQuery as global (TODO: remove these) // expose jQuery as global (TODO: remove these)
window.jQuery = jQuery; window.jQuery = jQuery;
...@@ -266,5 +267,8 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -266,5 +267,8 @@ document.addEventListener('DOMContentLoaded', () => {
}); });
} }
// initialize field errors
$('.gl-show-field-errors').each((i, form) => new GlFieldErrors(form));
initDispatcher(); 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