Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b97fd7fa
Commit
b97fd7fa
authored
Jan 21, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add event delegation to prevent events from not firing in certain states.
parent
0ef587b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
17 deletions
+28
-17
app/assets/javascripts/merge_request_widget/ci_bundle.js.es6
app/assets/javascripts/merge_request_widget/ci_bundle.js.es6
+28
-17
No files found.
app/assets/javascripts/merge_request_widget/ci_bundle.js.es6
View file @
b97fd7fa
...
@@ -8,31 +8,42 @@
...
@@ -8,31 +8,42 @@
* temporarily.
* temporarily.
* */
* */
if ($('.accept-mr-form').length) {
$(document)
$('.accept-mr-form').on('ajax:send', () => {
.off('ajax:send', '.accept-mr-form')
.on('ajax:send', '.accept-mr-form', () => {
$('.accept-mr-form :input').disable();
$('.accept-mr-form :input').disable();
});
});
$('.accept_merge_request').on('click', () => {
$(document)
.off('click', '.accept_merge_request')
.on('click', '.accept_merge_request', () => {
$('.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', () => {
$(document)
.off('click', '.merge_when_build_succeeds')
.on('click', '.merge_when_build_succeeds', () => {
$('#merge_when_build_succeeds').val('1');
$('#merge_when_build_succeeds').val('1');
});
});
$('.js-merge-dropdown a').on('click', (e) => {
$(document)
.off('click', '.js-merge-dropdown a')
.on('click', '.js-merge-dropdown a', (e) => {
e.preventDefault();
e.preventDefault();
$(this).closest('form').submit();
$(this).closest('form').submit();
});
});
} else
if ($('.rebase-in-progress').length) {
if ($('.rebase-in-progress').length) {
merge_request_widget.rebaseInProgress();
merge_request_widget.rebaseInProgress();
} else if ($('.rebase-mr-form').length) {
} else if ($('.rebase-mr-form').length) {
$('.rebase-mr-form').on('ajax:send', () => {
$(document)
.off('ajax:send', '.rebase-mr-form')
.on('ajax:send', '.rebase-mr-form', () => {
$('.rebase-mr-form :input').disable();
$('.rebase-mr-form :input').disable();
});
});
$('.js-rebase-button').on('click', () => {
$(document)
.off('click', '.js-rebase-button')
.on('click', '.js-rebase-button', () => {
$('.js-rebase-button').html("<i class='fa fa-spinner fa-spin'></i> Rebase in progress");
$('.js-rebase-button').html("<i class='fa fa-spinner fa-spin'></i> Rebase in progress");
});
});
} else {
} else {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment