summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-16 19:53:38 +0100
committerDouwe Maan <douwe@gitlab.com>2015-12-16 19:53:38 +0100
commit2d0f9dd02e549102e3b6e35ce39731ade3e5d917 (patch)
tree3c75f19f2232ac6fe3fdf6d5a18435a7e06cd0e5
parent76708c2c184e8bd561966ad7e617df31ceac95d1 (diff)
downloadgitlab-ce-fix-merge-immediately-button.tar.gz
Fix merge widget JS for buttonsfix-merge-immediately-button
-rw-r--r--app/views/projects/merge_requests/widget/open/_accept.html.haml18
1 files changed, 8 insertions, 10 deletions
diff --git a/app/views/projects/merge_requests/widget/open/_accept.html.haml b/app/views/projects/merge_requests/widget/open/_accept.html.haml
index 4ba04db3b7c..d9a1730a8bc 100644
--- a/app/views/projects/merge_requests/widget/open/_accept.html.haml
+++ b/app/views/projects/merge_requests/widget/open/_accept.html.haml
@@ -13,7 +13,7 @@
%span.caret
%span.sr-only
Select Merge Moment
- %ul.dropdown-menu.dropdown-menu-right{ role: 'menu' }
+ %ul.js-merge-dropdown.dropdown-menu.dropdown-menu-right{ role: 'menu' }
%li
= link_to "#", class: "merge_when_build_succeeds" do
= icon('check fw')
@@ -42,21 +42,19 @@
= hidden_field_tag :merge_when_build_succeeds, "", autocomplete: "off"
:javascript
- $('.accept_merge_request').on('click', function() {
- $('.js-merge-button').html("<i class='fa fa-spinner fa-spin'></i> Merge in progress");
- });
-
$('.accept-mr-form').on('ajax:send', function() {
$(".accept-mr-form :input").disable();
});
- $('a.accept_merge_request').on('click', function(e) {
- e.preventDefault();
- $(this).closest("form").submit();
+ $('.accept_merge_request').on('click', function() {
+ $('.js-merge-button').html("<i class='fa fa-spinner fa-spin'></i> Merge in progress");
});
- $('a.merge_when_build_succeeds').on('click', function(e) {
- e.preventDefault();
+ $('.merge_when_build_succeeds').on('click', function() {
$("#merge_when_build_succeeds").val("1");
+ });
+
+ $('.js-merge-dropdown a').on('click', function(e) {
+ e.preventDefault();
$(this).closest("form").submit();
});