Commit d8740cfe authored by Bryce Johnson's avatar Bryce Johnson

Move javascript for widget check to ci_bundle.

parent 3bbe19d3
$(() => { /* global merge_request_widget */
/* TODO: This needs a better home, or should be refactored. It was previously contained
* in a script tag in app/views/projects/merge_requests/widget/open/_accept.html.haml,
* but Vue chokes on script tags and prevents their execution. So it was moved here
* temporarily.
* */
$('.accept-mr-form').on('ajax:send', () => { (() => {
$('.accept-mr-form :input').disable(); $(() => {
}); /* TODO: This needs a better home, or should be refactored. It was previously contained
* in a script tag in app/views/projects/merge_requests/widget/open/_accept.html.haml,
* but Vue chokes on script tags and prevents their execution. So it was moved here
* temporarily.
* */
$('.accept_merge_request').on('click', () => { if ($('.accept-mr-form').length) {
$('.js-merge-button').html('<i class="fa fa-spinner fa-spin"></i> Merge in progress'); $('.accept-mr-form').on('ajax:send', () => {
}); $('.accept-mr-form :input').disable();
});
$('.merge_when_build_succeeds').on('click', () => { $('.accept_merge_request').on('click', () => {
$('#merge_when_build_succeeds').val('1'); $('.js-merge-button').html('<i class="fa fa-spinner fa-spin"></i> Merge in progress');
}); });
$('.merge_when_build_succeeds').on('click', () => {
$('#merge_when_build_succeeds').val('1');
});
$('.js-merge-dropdown a').on('click', (e) => {
e.preventDefault();
$(this).closest('form').submit();
});
} else if ($('.rebase-in-progress').length) {
merge_request_widget.rebaseInProgress();
} else if ($('.rebase-mr-form').length) {
$('.rebase-mr-form').on('ajax:send', () => {
$('.rebase-mr-form :input').disable();
});
$('.js-merge-dropdown a').on('click', (e) => { $('.js-rebase-button').on('click', () => {
e.preventDefault(); $('.js-rebase-button').html("<i class='fa fa-spinner fa-spin'></i> Rebase in progress");
$(this).closest('form').submit(); });
} else {
merge_request_widget.getMergeStatus();
}
}); });
}); })();
- content_for :page_specific_javascripts do
= page_specific_javascript_tag('merge_request_widget/ci_bundle.js')
%strong %strong
= icon("spinner spin") = icon("spinner spin")
Checking ability to merge automatically&hellip; Checking ability to merge automatically&hellip;
:javascript
$(function() {
merge_request_widget.getMergeStatus();
});
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