Commit 850b8bbd authored by Denys Mishunov's avatar Denys Mishunov Committed by Brandon Labuschagne

Took the NotesApp out of the global scope

parent b8b6fb29
...@@ -5,9 +5,12 @@ import initSortDiscussions from './sort_discussions'; ...@@ -5,9 +5,12 @@ import initSortDiscussions from './sort_discussions';
import { store } from './stores'; import { store } from './stores';
import initTimelineToggle from './timeline'; import initTimelineToggle from './timeline';
const el = document.getElementById('js-vue-notes'); export default () => {
const el = document.getElementById('js-vue-notes');
if (!el) {
return;
}
if (el) {
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Vue({ new Vue({
el, el,
...@@ -59,4 +62,4 @@ if (el) { ...@@ -59,4 +62,4 @@ if (el) {
initDiscussionFilters(store); initDiscussionFilters(store);
initSortDiscussions(store); initSortDiscussions(store);
initTimelineToggle(store); initTimelineToggle(store);
} };
...@@ -3,10 +3,10 @@ import ShortcutsIssuable from '~/behaviors/shortcuts/shortcuts_issuable'; ...@@ -3,10 +3,10 @@ import ShortcutsIssuable from '~/behaviors/shortcuts/shortcuts_issuable';
import initIssuableSidebar from '~/init_issuable_sidebar'; import initIssuableSidebar from '~/init_issuable_sidebar';
import { IssuableType } from '~/issuable_show/constants'; import { IssuableType } from '~/issuable_show/constants';
import Issue from '~/issue'; import Issue from '~/issue';
import '~/notes/index';
import initIncidentApp from '~/issue_show/incident'; import initIncidentApp from '~/issue_show/incident';
import { initIssuableApp, initIssueHeaderActions } from '~/issue_show/issue'; import { initIssuableApp, initIssueHeaderActions } from '~/issue_show/issue';
import { parseIssuableData } from '~/issue_show/utils/parse_data'; import { parseIssuableData } from '~/issue_show/utils/parse_data';
import initNotesApp from '~/notes/index';
import { store } from '~/notes/stores'; import { store } from '~/notes/stores';
import initRelatedMergeRequestsApp from '~/related_merge_requests'; import initRelatedMergeRequestsApp from '~/related_merge_requests';
import initSentryErrorStackTraceApp from '~/sentry_error_stack_trace'; import initSentryErrorStackTraceApp from '~/sentry_error_stack_trace';
...@@ -14,6 +14,8 @@ import initIssuableHeaderWarning from '~/vue_shared/components/issuable/init_iss ...@@ -14,6 +14,8 @@ import initIssuableHeaderWarning from '~/vue_shared/components/issuable/init_iss
import ZenMode from '~/zen_mode'; import ZenMode from '~/zen_mode';
export default function initShowIssue() { export default function initShowIssue() {
initNotesApp();
const initialDataEl = document.getElementById('js-issuable-app'); const initialDataEl = document.getElementById('js-issuable-app');
const { issueType, ...issuableData } = parseIssuableData(initialDataEl); const { issueType, ...issuableData } = parseIssuableData(initialDataEl);
......
...@@ -2,9 +2,10 @@ import ShortcutsEpic from 'ee/behaviors/shortcuts/shortcuts_epic'; ...@@ -2,9 +2,10 @@ import ShortcutsEpic from 'ee/behaviors/shortcuts/shortcuts_epic';
import initEpicApp from 'ee/epic/epic_bundle'; import initEpicApp from 'ee/epic/epic_bundle';
import EpicTabs from 'ee/epic/epic_tabs'; import EpicTabs from 'ee/epic/epic_tabs';
import loadAwardsHandler from '~/awards_handler'; import loadAwardsHandler from '~/awards_handler';
import initNotesApp from '~/notes/index';
import ZenMode from '~/zen_mode'; import ZenMode from '~/zen_mode';
import '~/notes/index';
initNotesApp();
initEpicApp(); initEpicApp();
requestIdleCallback(() => { requestIdleCallback(() => {
......
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