diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2018-01-11 12:24:29 -0600 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2018-01-11 12:24:29 -0600 |
commit | cb4cbcdca7d1437181a5e7ae980ca1cfc8aab831 (patch) | |
tree | 200c2e4fa282661eeba9734ca537ea7b6a68216c /app | |
parent | 685780d5b4606dce440ba8121e774fd6e7884ea2 (diff) | |
download | gitlab-ce-cb4cbcdca7d1437181a5e7ae980ca1cfc8aab831.tar.gz |
Refactor dispatcher project mr index pathdispatcher-project-mr
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/dispatcher.js | 5 | ||||
-rw-r--r-- | app/assets/javascripts/pages/projects/merge_requests/index/index.js | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index 72a6426e901..43f395d16e4 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -152,6 +152,11 @@ import Activities from './activities'; new UsersSelect(); break; case 'projects:merge_requests:index': + import('./pages/projects/merge_requests/index') + .then(callDefault) + .catch(fail); + shortcut_handler = true; + break; case 'projects:issues:index': if (filteredSearchEnabled) { const filteredSearchManager = new gl.FilteredSearchManager(page === 'projects:issues:index' ? 'issues' : 'merge_requests'); diff --git a/app/assets/javascripts/pages/projects/merge_requests/index/index.js b/app/assets/javascripts/pages/projects/merge_requests/index/index.js new file mode 100644 index 00000000000..a52bea03aa2 --- /dev/null +++ b/app/assets/javascripts/pages/projects/merge_requests/index/index.js @@ -0,0 +1,16 @@ +import IssuableIndex from '~/issuable_index'; +import ShortcutsNavigation from '~/shortcuts_navigation'; +import UsersSelect from '~/users_select'; + +export default () => { + const filteredSearchEnabled = gl.FilteredSearchManager && document.querySelector('.filtered-search'); + + if (filteredSearchEnabled) { + const filteredSearchManager = new gl.FilteredSearchManager('merge_requests'); + filteredSearchManager.setup(); + } + + new IssuableIndex('merge_request_'); // eslint-disable-line no-new + new ShortcutsNavigation(); // eslint-disable-line no-new + new UsersSelect(); // eslint-disable-line no-new +}; |