refactored use of for projects:tree:*

This commit is contained in:
Constance Okoghenun 2018-01-15 10:44:09 +01:00
parent 24fa3461e1
commit ae04c858b9
2 changed files with 3 additions and 5 deletions

View file

@ -411,10 +411,9 @@ import { fetchCommitMergeRequests } from './commit_merge_requests';
break;
case 'projects:tree:show':
import('./pages/projects/tree/show')
.then((module) => {
shortcut_handler = module.default();
})
.then(callDefault)
.catch(fail);
shortcut_handler = true;
break;
case 'projects:find_file:show':
const findElement = document.querySelector('.js-file-finder');

View file

@ -5,12 +5,11 @@ 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));
return new ShortcutsNavigation(); // eslint-disable-line no-new
};