Commit d7f70b77 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'projects-tree-tags-dispatcher-refactor' into 'master'

Refactored import of projects:tags:* and projects:tree:* of dispatcher.js

See merge request gitlab-org/gitlab-ce!16452
parents 89f9074f ae04c858
...@@ -10,7 +10,6 @@ import notificationsDropdown from './notifications_dropdown'; ...@@ -10,7 +10,6 @@ import notificationsDropdown from './notifications_dropdown';
import groupAvatar from './group_avatar'; import groupAvatar from './group_avatar';
import GroupLabelSubscription from './group_label_subscription'; import GroupLabelSubscription from './group_label_subscription';
import LineHighlighter from './line_highlighter'; import LineHighlighter from './line_highlighter';
import NewCommitForm from './new_commit_form';
import Project from './project'; import Project from './project';
import projectAvatar from './project_avatar'; import projectAvatar from './project_avatar';
import MergeRequest from './merge_request'; import MergeRequest from './merge_request';
...@@ -33,7 +32,6 @@ import ShortcutsWiki from './shortcuts_wiki'; ...@@ -33,7 +32,6 @@ import ShortcutsWiki from './shortcuts_wiki';
import BlobViewer from './blob/viewer/index'; import BlobViewer from './blob/viewer/index';
import AutoWidthDropdownSelect from './issuable/auto_width_dropdown_select'; import AutoWidthDropdownSelect from './issuable/auto_width_dropdown_select';
import UsersSelect from './users_select'; import UsersSelect from './users_select';
import RefSelectDropdown from './ref_select_dropdown';
import GfmAutoComplete from './gfm_auto_complete'; import GfmAutoComplete from './gfm_auto_complete';
import Star from './star'; import Star from './star';
import TreeView from './tree'; import TreeView from './tree';
...@@ -258,9 +256,9 @@ import { fetchCommitMergeRequests } from './commit_merge_requests'; ...@@ -258,9 +256,9 @@ import { fetchCommitMergeRequests } from './commit_merge_requests';
new AutoWidthDropdownSelect($('.js-target-branch-select')).init(); new AutoWidthDropdownSelect($('.js-target-branch-select')).init();
break; break;
case 'projects:tags:new': case 'projects:tags:new':
new ZenMode(); import('./pages/projects/tags/new')
new GLForm($('.tag-form'), true); .then(callDefault)
new RefSelectDropdown($('.js-branch-select')); .catch(fail);
break; break;
case 'projects:snippets:show': case 'projects:snippets:show':
initNotes(); initNotes();
...@@ -429,13 +427,10 @@ import { fetchCommitMergeRequests } from './commit_merge_requests'; ...@@ -429,13 +427,10 @@ import { fetchCommitMergeRequests } from './commit_merge_requests';
groupAvatar(); groupAvatar();
break; break;
case 'projects:tree:show': case 'projects:tree:show':
shortcut_handler = new ShortcutsNavigation(); import('./pages/projects/tree/show')
new TreeView(); .then(callDefault)
new BlobViewer(); .catch(fail);
new NewCommitForm($('.js-create-dir-form')); shortcut_handler = true;
$('#tree-slider').waitForImages(function() {
ajaxGet(document.querySelector('.js-tree-content').dataset.logsPath);
});
break; break;
case 'projects:find_file:show': case 'projects:find_file:show':
import('./pages/projects/find_file/show') import('./pages/projects/find_file/show')
......
import RefSelectDropdown from '../../../../ref_select_dropdown';
import ZenMode from '../../../../zen_mode';
import GLForm from '../../../../gl_form';
export default () => {
new ZenMode(); // eslint-disable-line no-new
new GLForm($('.tag-form'), true); // eslint-disable-line no-new
new RefSelectDropdown($('.js-branch-select')); // eslint-disable-line no-new
};
import TreeView from '../../../../tree';
import ShortcutsNavigation from '../../../../shortcuts_navigation';
import BlobViewer from '../../../../blob/viewer';
import NewCommitForm from '../../../../new_commit_form';
import { ajaxGet } from '../../../../lib/utils/common_utils';
export default () => {
new ShortcutsNavigation(); // eslint-disable-line no-new
new TreeView(); // eslint-disable-line no-new
new BlobViewer(); // eslint-disable-line no-new
new NewCommitForm($('.js-create-dir-form')); // eslint-disable-line no-new
$('#tree-slider').waitForImages(() =>
ajaxGet(document.querySelector('.js-tree-content').dataset.logsPath));
};
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