Commit b3ae4b9a authored by Bryce Johnson's avatar Bryce Johnson

Move script tag content in widget views into ci_bundle.

parent e315e3ea
...@@ -5,20 +5,35 @@ $(() => { ...@@ -5,20 +5,35 @@ $(() => {
* temporarily. * temporarily.
* */ * */
$('.accept-mr-form').on('ajax:send', () => { if ($('.accept-mr-form').length) {
$('.accept-mr-form :input').disable(); $('.accept-mr-form').on('ajax:send', () => {
}); $('.accept-mr-form :input').disable();
});
$('.accept_merge_request').on('click', () => { $('.accept_merge_request').on('click', () => {
$('.js-merge-button').html('<i class="fa fa-spinner fa-spin"></i> Merge in progress'); $('.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').on('click', () => {
$('#merge_when_build_succeeds').val('1'); $('#merge_when_build_succeeds').val('1');
}); });
$('.js-merge-dropdown a').on('click', (e) => { $('.js-merge-dropdown a').on('click', (e) => {
e.preventDefault(); e.preventDefault();
$(this).closest('form').submit(); $(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', function() {
$('.rebase-mr-form :input').disable();
});
$('.js-rebase-button').on('click', function() {
$('.js-rebase-button').html("<i class='fa fa-spinner fa-spin'></i> Rebase in progress");
});
} 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();
});
- content_for :page_specific_javascripts do
= page_specific_javascript_tag('merge_request_widget/ci_bundle.js')
- if @merge_request.rebase_in_progress? || (defined?(rebase_in_progress) && rebase_in_progress) - if @merge_request.rebase_in_progress? || (defined?(rebase_in_progress) && rebase_in_progress)
%h4 %h4.rebase-in-progress
= icon("spinner spin") = icon("spinner spin")
Rebase in progress&hellip; Rebase in progress&hellip;
%p %p
This merge request is in the process of being rebased. This merge request is in the process of being rebased.
:javascript
$(function() {
merge_request_widget.rebaseInProgress()
});
- elsif !can_push_branch?(@merge_request.source_project, @merge_request.source_branch) - elsif !can_push_branch?(@merge_request.source_project, @merge_request.source_branch)
%h4 %h4
= icon("exclamation-triangle") = icon("exclamation-triangle")
...@@ -26,12 +25,3 @@ ...@@ -26,12 +25,3 @@
Rebase onto #{@merge_request.target_branch} Rebase onto #{@merge_request.target_branch}
.accept-control .accept-control
Fast-forward merge is not possible. Rebase the source branch onto the target branch or merge target branch into source branch to allow this merge request to be merged. Fast-forward merge is not possible. Rebase the source branch onto the target branch or merge target branch into source branch to allow this merge request to be merged.
:javascript
$('.rebase-mr-form').on('ajax:send', function() {
$('.rebase-mr-form :input').disable();
});
$('.js-rebase-button').on('click', function() {
$('.js-rebase-button').html("<i class='fa fa-spinner fa-spin'></i> Rebase in progress");
});
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