summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pages/projects/merge_requests/show/index.js
blob: c3463c266e3cf0214aef8e86202b2b642d9ba766 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import MergeRequest from '~/merge_request';
import ZenMode from '~/zen_mode';
import initNotes from '~/init_notes';
import initIssuableSidebar from '~/init_issuable_sidebar';
import ShortcutsIssuable from '~/shortcuts_issuable';
import Diff from '~/diff';
import { handleLocationHash } from '~/lib/utils/common_utils';

export default () => {
  new Diff(); // eslint-disable-line no-new
  new ZenMode(); // eslint-disable-line no-new

  initIssuableSidebar(); // eslint-disable-line no-new
  initNotes(); // eslint-disable-line no-new

  const mrShowNode = document.querySelector('.merge-request');

  window.mergeRequest = new MergeRequest({
    action: mrShowNode.dataset.mrAction,
  });

  new ShortcutsIssuable(true); // eslint-disable-line no-new
  handleLocationHash();
};