debian-mirror-gitlab/app/assets/javascripts/pages/groups/show/index.js

29 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-03-17 18:26:18 +05:30
/* eslint-disable no-new */
2018-11-20 20:47:30 +05:30
import { getPagePath } from '~/lib/utils/common_utils';
import { ACTIVE_TAB_SHARED, ACTIVE_TAB_ARCHIVED } from '~/groups/constants';
2018-03-17 18:26:18 +05:30
import NewGroupChild from '~/groups/new_group_child';
import notificationsDropdown from '~/notifications_dropdown';
import NotificationsForm from '~/notifications_form';
import ProjectsList from '~/projects_list';
import ShortcutsNavigation from '~/shortcuts_navigation';
2018-11-20 20:47:30 +05:30
import GroupTabs from './group_tabs';
2018-03-17 18:26:18 +05:30
document.addEventListener('DOMContentLoaded', () => {
const newGroupChildWrapper = document.querySelector('.js-new-project-subgroup');
2018-11-20 20:47:30 +05:30
const loadableActions = [ACTIVE_TAB_SHARED, ACTIVE_TAB_ARCHIVED];
const paths = window.location.pathname.split('/');
const subpath = paths[paths.length - 1];
const action = loadableActions.includes(subpath) ? subpath : getPagePath(1);
new GroupTabs({ parentEl: '.groups-listing', action });
2018-03-17 18:26:18 +05:30
new ShortcutsNavigation();
new NotificationsForm();
notificationsDropdown();
new ProjectsList();
if (newGroupChildWrapper) {
new NewGroupChild(newGroupChildWrapper);
}
});