summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pages/groups/new/index.js
blob: 569b5afd67654ef7c6cf579f2dc5203dbade69ea (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
25
26
import $ from 'jquery';
import BindInOut from '~/behaviors/bind_in_out';
import initFilePickers from '~/file_pickers';
import Group from '~/group';
import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs';
import GroupPathValidator from './group_path_validator';

new GroupPathValidator(); // eslint-disable-line no-new

BindInOut.initAll();
initFilePickers();

new Group(); // eslint-disable-line no-new

const CONTAINER_SELECTOR = '.group-edit-container .nav-tabs';
const DEFAULT_ACTION = '#create-group-pane';
// eslint-disable-next-line no-new
new LinkedTabs({
  defaultAction: DEFAULT_ACTION,
  parentEl: CONTAINER_SELECTOR,
  hashedTabs: true,
});

if (window.location.hash) {
  $(CONTAINER_SELECTOR).find(`a[href="${window.location.hash}"]`).tab('show');
}