diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-06-15 15:23:02 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-06-15 15:23:02 +0000 |
commit | 93a496d270cb638c76a4df45a74121c189146888 (patch) | |
tree | 58ab209070081eef12ab1d54ccd5274eaedbb2c5 /app/assets/javascripts | |
parent | 2f459a03e00deb21bd774cb91dc0749b2e7c8905 (diff) | |
parent | 22e97dd702182aa51586972bb54861ee8b19846b (diff) | |
download | gitlab-ce-93a496d270cb638c76a4df45a74121c189146888.tar.gz |
Merge branch 'mr-buttons-update' into 'master'
Fixed issue with MR buttons being in a group
## What does this MR do?
Fixes design issue with the buttons in the merge request widget
## Screenshots (if relevant)
![Screen_Shot_2016-06-09_at_14.13.32](/uploads/44ac4175f5a97a8d7baf97be6eebc684/Screen_Shot_2016-06-09_at_14.13.32.png)
See merge request !4562
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/dispatcher.js.coffee | 4 | ||||
-rw-r--r-- | app/assets/javascripts/merged_buttons.js.coffee | 30 |
2 files changed, 34 insertions, 0 deletions
diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee index 29ac0f70b30..8b39e6b090c 100644 --- a/app/assets/javascripts/dispatcher.js.coffee +++ b/app/assets/javascripts/dispatcher.js.coffee @@ -53,9 +53,13 @@ class Dispatcher new Diff() shortcut_handler = new ShortcutsIssuable(true) new ZenMode() + new MergedButtons() + when 'projects:merge_requests:commits', 'projects:merge_requests:builds' + new MergedButtons() when "projects:merge_requests:diffs" new Diff() new ZenMode() + new MergedButtons() when 'projects:merge_requests:index' shortcut_handler = new ShortcutsNavigation() Issuable.init() diff --git a/app/assets/javascripts/merged_buttons.js.coffee b/app/assets/javascripts/merged_buttons.js.coffee new file mode 100644 index 00000000000..4929295c10b --- /dev/null +++ b/app/assets/javascripts/merged_buttons.js.coffee @@ -0,0 +1,30 @@ +class @MergedButtons + constructor: -> + @$removeBranchWidget = $('.remove_source_branch_widget') + @$removeBranchProgress = $('.remove_source_branch_in_progress') + @$removeBranchFailed = $('.remove_source_branch_widget.failed') + + @cleanEventListeners() + @initEventListeners() + + cleanEventListeners: -> + $(document).off 'click', '.remove_source_branch' + $(document).off 'ajax:success', '.remove_source_branch' + $(document).off 'ajax:error', '.remove_source_branch' + + initEventListeners: -> + $(document).on 'click', '.remove_source_branch', @removeSourceBranch + $(document).on 'ajax:success', '.remove_source_branch', @removeBranchSuccess + $(document).on 'ajax:error', '.remove_source_branch', @removeBranchError + + removeSourceBranch: => + @$removeBranchWidget.hide() + @$removeBranchProgress.show() + + removeBranchSuccess: -> + location.reload() + + removeBranchError: -> + @$removeBranchWidget.hide() + @$removeBranchProgress.hide() + @$removeBranchFailed.show() |