Commit c12e4de5 authored by Douwe Maan's avatar Douwe Maan

Move "Start new merge request" checkbox closer to New branch field

parent 03277af6
...@@ -3,7 +3,7 @@ class @NewCommitForm ...@@ -3,7 +3,7 @@ class @NewCommitForm
@newBranch = form.find('.js-new-branch') @newBranch = form.find('.js-new-branch')
@originalBranch = form.find('.js-original-branch') @originalBranch = form.find('.js-original-branch')
@createMergeRequest = form.find('.js-create-merge-request') @createMergeRequest = form.find('.js-create-merge-request')
@createMergeRequestFormGroup = form.find('.js-create-merge-request-form-group') @createMergeRequestContainer = form.find('.js-create-merge-request-container')
@renderDestination() @renderDestination()
@newBranch.keyup @renderDestination @newBranch.keyup @renderDestination
...@@ -12,10 +12,10 @@ class @NewCommitForm ...@@ -12,10 +12,10 @@ class @NewCommitForm
different = @newBranch.val() != @originalBranch.val() different = @newBranch.val() != @originalBranch.val()
if different if different
@createMergeRequestFormGroup.show() @createMergeRequestContainer.show()
@createMergeRequest.prop('checked', true) unless @wasDifferent @createMergeRequest.prop('checked', true) unless @wasDifferent
else else
@createMergeRequestFormGroup.hide() @createMergeRequestContainer.hide()
@createMergeRequest.prop('checked', false) @createMergeRequest.prop('checked', false)
@wasDifferent = different @wasDifferent = different
...@@ -7,12 +7,11 @@ ...@@ -7,12 +7,11 @@
.col-sm-10 .col-sm-10
= text_field_tag 'new_branch', @new_branch || @ref, class: "form-control js-new-branch" = text_field_tag 'new_branch', @new_branch || @ref, class: "form-control js-new-branch"
.form-group.js-create-merge-request-form-group .js-create-merge-request-container
.col-sm-offset-2.col-sm-10 .checkbox
.checkbox - nonce = SecureRandom.hex
- nonce = SecureRandom.hex = label_tag "create_merge_request-#{nonce}" do
= label_tag "create_merge_request-#{nonce}" do = check_box_tag 'create_merge_request', 1, true, class: 'js-create-merge-request', id: "create_merge_request-#{nonce}"
= check_box_tag 'create_merge_request', 1, true, class: 'js-create-merge-request', id: "create_merge_request-#{nonce}" Start a <strong>new merge request</strong> with these changes
Start a <strong>new merge request</strong> with this commit
= hidden_field_tag 'original_branch', @ref, class: 'js-original-branch' = hidden_field_tag 'original_branch', @ref, class: 'js-original-branch'
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