Commit ae04c858 authored by Constance Okoghenun's avatar Constance Okoghenun

refactored use of for projects:tree:*

parent 24fa3461
...@@ -411,10 +411,9 @@ import { fetchCommitMergeRequests } from './commit_merge_requests'; ...@@ -411,10 +411,9 @@ import { fetchCommitMergeRequests } from './commit_merge_requests';
break; break;
case 'projects:tree:show': case 'projects:tree:show':
import('./pages/projects/tree/show') import('./pages/projects/tree/show')
.then((module) => { .then(callDefault)
shortcut_handler = module.default();
})
.catch(fail); .catch(fail);
shortcut_handler = true;
break; break;
case 'projects:find_file:show': case 'projects:find_file:show':
const findElement = document.querySelector('.js-file-finder'); const findElement = document.querySelector('.js-file-finder');
......
...@@ -5,12 +5,11 @@ import NewCommitForm from '../../../../new_commit_form'; ...@@ -5,12 +5,11 @@ import NewCommitForm from '../../../../new_commit_form';
import { ajaxGet } from '../../../../lib/utils/common_utils'; import { ajaxGet } from '../../../../lib/utils/common_utils';
export default () => { export default () => {
new ShortcutsNavigation(); // eslint-disable-line no-new
new TreeView(); // eslint-disable-line no-new new TreeView(); // eslint-disable-line no-new
new BlobViewer(); // eslint-disable-line no-new new BlobViewer(); // eslint-disable-line no-new
new NewCommitForm($('.js-create-dir-form')); // eslint-disable-line no-new new NewCommitForm($('.js-create-dir-form')); // eslint-disable-line no-new
$('#tree-slider').waitForImages(() => $('#tree-slider').waitForImages(() =>
ajaxGet(document.querySelector('.js-tree-content').dataset.logsPath)); ajaxGet(document.querySelector('.js-tree-content').dataset.logsPath));
return new ShortcutsNavigation(); // eslint-disable-line no-new
}; };
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