summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pages/projects/branches/index/index.js
blob: 97dc76908afcaf1e5964eab6b36fbd3ed06b9f65 (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 initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_behavior';
import AjaxLoadingSpinner from '~/branches/ajax_loading_spinner';
import BranchSortDropdown from '~/branches/branch_sort_dropdown';
import DeleteModal from '~/branches/branches_delete_modal';
import initDiverganceGraph from '~/branches/divergence_graph';
import initDeleteBranchButton from '~/branches/init_delete_branch_button';
import initDeleteBranchModal from '~/branches/init_delete_branch_modal';

AjaxLoadingSpinner.init();
new DeleteModal(); // eslint-disable-line no-new

const { divergingCountsEndpoint, defaultBranch } = document.querySelector(
  '.js-branch-list',
).dataset;

initDiverganceGraph(divergingCountsEndpoint, defaultBranch);
BranchSortDropdown();
initDeprecatedRemoveRowBehavior();

document
  .querySelectorAll('.js-delete-branch-button')
  .forEach((elem) => initDeleteBranchButton(elem));

initDeleteBranchModal();