summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();
});