diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-09-13 16:01:12 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-09-13 23:59:17 -0500 |
commit | c7afb8f8853ba4f88182751ac776825e6a000a03 (patch) | |
tree | 4462d6ba904ff140b1d3da1dce7f8ecee64b178e /app/assets/javascripts | |
parent | 105ab36b68b16422d57f16c84b4dd2ea2eabe17a (diff) | |
download | gitlab-ce-c7afb8f8853ba4f88182751ac776825e6a000a03.tar.gz |
Move initFieldErrors from dispatcher to main.js
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/dispatcher.js | 8 | ||||
-rw-r--r-- | app/assets/javascripts/main.js | 4 |
2 files changed, 4 insertions, 8 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index a5af37e80b6..192d8ca60fe 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -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) { diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index debc585b783..393d195549f 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -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(); }); |