diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2018-01-12 12:37:47 -0600 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2018-01-12 12:37:47 -0600 |
commit | 11e059d757ac37aa9f1488344253a1df4177d962 (patch) | |
tree | 291cd52fa0c878641ad0b570fa704f8ee0368cd0 /app | |
parent | dc7465107fd5133324ae4a4cbf8315e80f5a5367 (diff) | |
download | gitlab-ce-11e059d757ac37aa9f1488344253a1df4177d962.tar.gz |
Use common form.jssnippets-dispatcher-refactor
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/dispatcher.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/pages/snippets/edit/index.js | 8 | ||||
-rw-r--r-- | app/assets/javascripts/pages/snippets/form.js (renamed from app/assets/javascripts/pages/snippets/create/index.js) | 0 | ||||
-rw-r--r-- | app/assets/javascripts/pages/snippets/new/index.js | 8 | ||||
-rw-r--r-- | app/assets/javascripts/pages/snippets/update/index.js | 7 |
5 files changed, 6 insertions, 21 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index 38fbc9ce4e0..ecd34372c4a 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -310,12 +310,12 @@ import Activities from './activities'; .catch(fail); break; case 'snippets:create': - import('./pages/snippets/create') + import('./pages/snippets/new') .then(callDefault) .catch(fail); break; case 'snippets:update': - import('./pages/snippets/update') + import('./pages/snippets/edit') .then(callDefault) .catch(fail); break; diff --git a/app/assets/javascripts/pages/snippets/edit/index.js b/app/assets/javascripts/pages/snippets/edit/index.js index f996d3cd74e..9c664b5f1ff 100644 --- a/app/assets/javascripts/pages/snippets/edit/index.js +++ b/app/assets/javascripts/pages/snippets/edit/index.js @@ -1,7 +1,3 @@ -import GLForm from '~/gl_form'; -import ZenMode from '~/zen_mode'; +import form from '../form'; -export default () => { - new GLForm($('.snippet-form'), false); // eslint-disable-line no-new - new ZenMode(); // eslint-disable-line no-new -}; +export default form; diff --git a/app/assets/javascripts/pages/snippets/create/index.js b/app/assets/javascripts/pages/snippets/form.js index f996d3cd74e..f996d3cd74e 100644 --- a/app/assets/javascripts/pages/snippets/create/index.js +++ b/app/assets/javascripts/pages/snippets/form.js diff --git a/app/assets/javascripts/pages/snippets/new/index.js b/app/assets/javascripts/pages/snippets/new/index.js index f996d3cd74e..9c664b5f1ff 100644 --- a/app/assets/javascripts/pages/snippets/new/index.js +++ b/app/assets/javascripts/pages/snippets/new/index.js @@ -1,7 +1,3 @@ -import GLForm from '~/gl_form'; -import ZenMode from '~/zen_mode'; +import form from '../form'; -export default () => { - new GLForm($('.snippet-form'), false); // eslint-disable-line no-new - new ZenMode(); // eslint-disable-line no-new -}; +export default form; diff --git a/app/assets/javascripts/pages/snippets/update/index.js b/app/assets/javascripts/pages/snippets/update/index.js deleted file mode 100644 index f996d3cd74e..00000000000 --- a/app/assets/javascripts/pages/snippets/update/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import GLForm from '~/gl_form'; -import ZenMode from '~/zen_mode'; - -export default () => { - new GLForm($('.snippet-form'), false); // eslint-disable-line no-new - new ZenMode(); // eslint-disable-line no-new -}; |