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
0
Merge Requests
0
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
Léo-Paul Géneau
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
Hide 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')
$('.accept-mr-form :input').disable();
.on('ajax:send', '.accept-mr-form', () => {
});
$('.accept-mr-form :input').disable();
});
$('.accept_merge_request').on('click', () => {
$(document)
$('.js-merge-button').html('<i class="fa fa-spinner fa-spin"></i> Merge in progress');
.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');
});
$('.merge_when_build_succeeds').on('click', () => {
$(document)
$('#merge_when_build_succeeds').val('1');
.off('click', '.merge_when_build_succeeds')
});
.on('click', '.merge_when_build_succeeds', () => {
$('#merge_when_build_succeeds').val('1');
});
$('.js-merge-dropdown a').on('click', (e) => {
$(document)
e.preventDefault();
.off('click', '.js-merge-dropdown a')
$(this).closest('form').submit();
.on('click', '.js-merge-dropdown a', (e) => {
});
e.preventDefault();
} else if ($('.rebase-in-progress').length) {
$(this).closest('form').submit();
});
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