diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-11-17 20:53:56 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-11-17 20:53:56 +0300 |
commit | e945ec02804bb28dbd228d8002a159c8da0fcc38 (patch) | |
tree | 72600162a61e7990d6c62ce5af90f5e649cc1e86 /app/assets/javascripts/blob | |
parent | 0b540a0fadf172277639910023fcf8b713ad35aa (diff) |
Add "Start a new merge request" option to every commit form
Diffstat (limited to 'app/assets/javascripts/blob')
-rw-r--r-- | app/assets/javascripts/blob/blob_file_dropzone.js.coffee | 17 | ||||
-rw-r--r-- | app/assets/javascripts/blob/edit_blob.js.coffee | 7 | ||||
-rw-r--r-- | app/assets/javascripts/blob/new_blob.js.coffee | 7 |
3 files changed, 3 insertions, 28 deletions
diff --git a/app/assets/javascripts/blob/blob_file_dropzone.js.coffee b/app/assets/javascripts/blob/blob_file_dropzone.js.coffee index 5b604adbbb1..195f8b11e5d 100644 --- a/app/assets/javascripts/blob/blob_file_dropzone.js.coffee +++ b/app/assets/javascripts/blob/blob_file_dropzone.js.coffee @@ -23,18 +23,6 @@ class @BlobFileDropzone init: -> this.on 'addedfile', (file) -> $('.dropzone-alerts').html('').hide() - commit_message = form.find('#commit_message')[0] - - if /^Upload/.test(commit_message.placeholder) - commit_message.placeholder = 'Upload ' + file.name - - return - - this.on 'removedfile', (file) -> - commit_message = form.find('#commit_message')[0] - - if /^Upload/.test(commit_message.placeholder) - commit_message.placeholder = 'Upload new file' return @@ -47,8 +35,9 @@ class @BlobFileDropzone return this.on 'sending', (file, xhr, formData) -> - formData.append('new_branch', form.find('#new_branch').val()) - formData.append('commit_message', form.find('#commit_message').val()) + formData.append('new_branch', form.find('.js-new-branch').val()) + formData.append('create_merge_request', form.find('.js-create-merge-request').val()) + formData.append('commit_message', form.find('.js-commit-message').val()) return # Override behavior of adding error underneath preview diff --git a/app/assets/javascripts/blob/edit_blob.js.coffee b/app/assets/javascripts/blob/edit_blob.js.coffee index bf4cd85aee0..f6bf836f19f 100644 --- a/app/assets/javascripts/blob/edit_blob.js.coffee +++ b/app/assets/javascripts/blob/edit_blob.js.coffee @@ -11,13 +11,6 @@ class @EditBlob if ace_mode editor.getSession().setMode "ace/mode/" + ace_mode - $('#new_branch').keyup -> - if $(this).val() != $('#original_branch').val() - $('.form-group.destination').show() - else - $('.form-group.destination').hide() - $('#create_merge_request').prop('checked', false) - # Before a form submission, move the content from the Ace editor into the # submitted textarea $('form').submit -> diff --git a/app/assets/javascripts/blob/new_blob.js.coffee b/app/assets/javascripts/blob/new_blob.js.coffee index c2d6c7acfef..68c5e5195e3 100644 --- a/app/assets/javascripts/blob/new_blob.js.coffee +++ b/app/assets/javascripts/blob/new_blob.js.coffee @@ -11,13 +11,6 @@ class @NewBlob if ace_mode editor.getSession().setMode "ace/mode/" + ace_mode - $('#new_branch').keyup -> - if $(this).val() != $('#original_branch').val() - $('.form-group.destination').show() - else - $('.form-group.destination').hide() - $('#create_merge_request').prop('checked', false) - # Before a form submission, move the content from the Ace editor into the # submitted textarea $('form').submit -> |