Commit 11eb5dc0 authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray Committed by Jose Ivan Vargas

Keep checkbox state saved on submit

parent 15a4a7d5
......@@ -367,9 +367,8 @@ import Vue from 'vue';
};
})(this));
$('#require_approvals').on('change', (e) => {
var $approvalInput = $('#project_approvals_before_merge');
$approvalInput.val($('#require_approvals').prop("checked") ? 1 : 0);
$('#require_approvals').on('change', function() {
$('#project_approvals_before_merge').val($(this).prop('checked') ? 1 : 0);
});
}
......
......@@ -46,7 +46,7 @@
.form-group.reset-approvals-on-push
.checkbox
= label_tag :require_approvals do
= check_box_tag :require_approvals
= check_box_tag :require_approvals, nil, project.approvals_before_merge > 0
%strong Activate merge request approvals
//TODO: correct help path
= link_to icon('question-circle'), "https://docs.gitlab.com/ee/user/project/merge_requests/merge_request_approvals.html#merge-request-approvals", target: '_blank'
......
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