diff options
Diffstat (limited to 'app/assets/javascripts/pages/dashboard')
3 files changed, 13 insertions, 11 deletions
diff --git a/app/assets/javascripts/pages/dashboard/groups/index/index.js b/app/assets/javascripts/pages/dashboard/groups/index/index.js index b9277106a71..c14848c4798 100644 --- a/app/assets/javascripts/pages/dashboard/groups/index/index.js +++ b/app/assets/javascripts/pages/dashboard/groups/index/index.js @@ -1,5 +1,3 @@ import initGroupsList from '~/groups'; -document.addEventListener('DOMContentLoaded', () => { - initGroupsList(); -}); +initGroupsList(); diff --git a/app/assets/javascripts/pages/dashboard/milestones/show/index.js b/app/assets/javascripts/pages/dashboard/milestones/show/index.js index 397149aaa9e..1f3e458fe17 100644 --- a/app/assets/javascripts/pages/dashboard/milestones/show/index.js +++ b/app/assets/javascripts/pages/dashboard/milestones/show/index.js @@ -2,8 +2,6 @@ import Milestone from '~/milestone'; import Sidebar from '~/right_sidebar'; import MountMilestoneSidebar from '~/sidebar/mount_milestone_sidebar'; -document.addEventListener('DOMContentLoaded', () => { - new Milestone(); // eslint-disable-line no-new - new Sidebar(); // eslint-disable-line no-new - new MountMilestoneSidebar(); // eslint-disable-line no-new -}); +new Milestone(); // eslint-disable-line no-new +new Sidebar(); // eslint-disable-line no-new +new MountMilestoneSidebar(); // eslint-disable-line no-new diff --git a/app/assets/javascripts/pages/dashboard/todos/index/todos.js b/app/assets/javascripts/pages/dashboard/todos/index/todos.js index 42341436b55..946076cfb29 100644 --- a/app/assets/javascripts/pages/dashboard/todos/index/todos.js +++ b/app/assets/javascripts/pages/dashboard/todos/index/todos.js @@ -4,7 +4,7 @@ import $ from 'jquery'; import { getGroups } from '~/api/groups_api'; import { getProjects } from '~/api/projects_api'; import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown'; -import { deprecatedCreateFlash as flash } from '~/flash'; +import createFlash from '~/flash'; import axios from '~/lib/utils/axios_utils'; import { isMetaClick } from '~/lib/utils/common_utils'; import { addDelimiter } from '~/lib/utils/text_utility'; @@ -103,7 +103,9 @@ export default class Todos { }) .catch(() => { this.updateRowState(target, true); - return flash(__('Error updating status of to-do item.')); + return createFlash({ + message: __('Error updating status of to-do item.'), + }); }); } @@ -145,7 +147,11 @@ export default class Todos { this.updateAllState(target, data); this.updateBadges(data); }) - .catch(() => flash(__('Error updating status for all to-do items.'))); + .catch(() => + createFlash({ + message: __('Error updating status for all to-do items.'), + }), + ); } updateAllState(target, data) { |