diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2018-01-11 00:02:24 -0600 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2018-01-11 00:02:24 -0600 |
commit | acefbad292e741cb2a60bd3eab81d9b05fd27961 (patch) | |
tree | fcf38d8770fac4bdd3acdcc2f6a4980d85de427e /app/assets | |
parent | 82007530cb08ccd8aff68aafdc506595f62a40a6 (diff) | |
download | gitlab-ce-acefbad292e741cb2a60bd3eab81d9b05fd27961.tar.gz |
Refactor dispatcher project branches create path
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/dispatcher.js | 8 | ||||
-rw-r--r-- | app/assets/javascripts/pages/projects/branches/create/index.js | 3 | ||||
-rw-r--r-- | app/assets/javascripts/pages/projects/branches/new/index.js | 3 |
3 files changed, 13 insertions, 1 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index a282b67b0fc..10c4931b7d6 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -266,8 +266,14 @@ import Activities from './activities'; initChangesDropdown(document.querySelector('.navbar-gitlab').offsetHeight - paddingTop); break; case 'projects:branches:new': + import('./pages/projects/branches/new') + .then(callDefault) + .catch(fail); + break; case 'projects:branches:create': - new NewBranchForm($('.js-create-branch-form'), JSON.parse(document.getElementById('availableRefs').innerHTML)); + import('./pages/projects/branches/new') + .then(callDefault) + .catch(fail); break; case 'projects:branches:index': AjaxLoadingSpinner.init(); diff --git a/app/assets/javascripts/pages/projects/branches/create/index.js b/app/assets/javascripts/pages/projects/branches/create/index.js new file mode 100644 index 00000000000..ae5e033e97e --- /dev/null +++ b/app/assets/javascripts/pages/projects/branches/create/index.js @@ -0,0 +1,3 @@ +import NewBranchForm from '~/new_branch_form'; + +export default () => new NewBranchForm($('.js-create-branch-form'), JSON.parse(document.getElementById('availableRefs').innerHTML)); diff --git a/app/assets/javascripts/pages/projects/branches/new/index.js b/app/assets/javascripts/pages/projects/branches/new/index.js new file mode 100644 index 00000000000..ae5e033e97e --- /dev/null +++ b/app/assets/javascripts/pages/projects/branches/new/index.js @@ -0,0 +1,3 @@ +import NewBranchForm from '~/new_branch_form'; + +export default () => new NewBranchForm($('.js-create-branch-form'), JSON.parse(document.getElementById('availableRefs').innerHTML)); |