diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee
index 29ac0f70b306804c571081bf90ef85a173f77fb2..8b39e6b090c8ba616ec325ee4dc4ead81df34d03 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 0000000000000000000000000000000000000000..4929295c10b5baca7f81e8d872d4ec35a04c6b6d
--- /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()
diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss
index a47f2580aa38d0b26d56205c1ffb448f43bfdfaa..53bff508c72b351ab9d79806db1f0c301df5aa2c 100644
--- a/app/assets/stylesheets/pages/merge_requests.scss
+++ b/app/assets/stylesheets/pages/merge_requests.scss
@@ -313,3 +313,13 @@
     }
   }
 }
+
+.merged-buttons {
+  .btn {
+    float: left;
+
+    &:not(:last-child) {
+      margin-right: 10px;
+    }
+  }
+}
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index d328f56c80caf9e4d3d00667b8ea16cd1b3eb81d..493505e0c9528363220be64db554a23d60a1fff6 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -129,7 +129,7 @@ module CommitsHelper
     tooltip = "Revert this #{commit.change_type_title} in a new merge request" if has_tooltip
 
     if can_collaborate_with_project?
-      btn_class = "btn btn-grouped btn-close btn-#{btn_class}" unless btn_class.nil?
+      btn_class = "btn btn-warning btn-#{btn_class}" unless btn_class.nil?
       link_to 'Revert', '#modal-revert-commit', 'data-toggle' => 'modal', 'data-container' => 'body', title: (tooltip if has_tooltip), class: "#{btn_class} #{'has-tooltip' if has_tooltip}"
     elsif can?(current_user, :fork_project, @project)
       continue_params = {
@@ -141,7 +141,7 @@ module CommitsHelper
         namespace_key: current_user.namespace.id,
         continue: continue_params)
 
-      btn_class = "btn btn-grouped btn-close" unless btn_class.nil?
+      btn_class = "btn btn-grouped btn-warning" unless btn_class.nil?
 
       link_to 'Revert', fork_path, class: btn_class, method: :post, 'data-toggle' => 'tooltip', 'data-container' => 'body', title: (tooltip if has_tooltip)
     end
@@ -153,7 +153,7 @@ module CommitsHelper
     tooltip = "Cherry-pick this #{commit.change_type_title} in a new merge request"
 
     if can_collaborate_with_project?
-      btn_class = "btn btn-default btn-grouped btn-#{btn_class}" unless btn_class.nil?
+      btn_class = "btn btn-default btn-#{btn_class}" unless btn_class.nil?
       link_to 'Cherry-pick', '#modal-cherry-pick-commit', 'data-toggle' => 'modal', 'data-container' => 'body', title: (tooltip if has_tooltip), class: "#{btn_class} #{'has-tooltip' if has_tooltip}"
     elsif can?(current_user, :fork_project, @project)
       continue_params = {
diff --git a/app/views/projects/merge_requests/widget/_merged.html.haml b/app/views/projects/merge_requests/widget/_merged.html.haml
index ec4beae9727b3ec07e64d584ae92e11662843b36..19b5d0ff0664f5b64a8acb04e372fe0ecf725e4b 100644
--- a/app/views/projects/merge_requests/widget/_merged.html.haml
+++ b/app/views/projects/merge_requests/widget/_merged.html.haml
@@ -6,46 +6,29 @@
       - if @merge_request.merge_event
         by #{link_to_member(@project, @merge_request.merge_event.author, avatar: true)}
         #{time_ago_with_tooltip(@merge_request.merge_event.created_at)}
-    %div
-      - if !@merge_request.source_branch_exists? || (params[:delete_source] == 'true')
+    - if !@merge_request.source_branch_exists? || (params[:delete_source] == 'true')
+      %p
+        The changes were merged into
+        #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}.
+        The source branch has been removed.
+      = render 'projects/merge_requests/widget/merged_buttons'
+    - elsif @merge_request.can_remove_source_branch?(current_user)
+      .remove_source_branch_widget
         %p
           The changes were merged into
           #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}.
-          The source branch has been removed.
-        = render 'projects/merge_requests/widget/merged_buttons'
-      - elsif @merge_request.can_remove_source_branch?(current_user)
-        .remove_source_branch_widget
-          %p
-            The changes were merged into
-            #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}.
-            You can remove the source branch now.
-          = render 'projects/merge_requests/widget/merged_buttons', source_branch_exists: true
-        .remove_source_branch_widget.failed.hide
-          %p
-            Failed to remove source branch '#{@merge_request.source_branch}'.
-
-        .remove_source_branch_in_progress.hide
-          %p
-            = icon('spinner spin')
-            Removing source branch '#{@merge_request.source_branch}'. Please wait, this page will be automatically reloaded.
-
-        :javascript
-          $('.remove_source_branch').on('click', function() {
-            $('.remove_source_branch_widget').hide();
-            $('.remove_source_branch_in_progress').show();
-          });
-
-          $(".remove_source_branch").on("ajax:success", function (e, data, status, xhr) {
-            location.reload();
-          });
+          You can remove the source branch now.
+        = render 'projects/merge_requests/widget/merged_buttons', source_branch_exists: true
+      .remove_source_branch_widget.failed.hide
+        %p
+          Failed to remove source branch '#{@merge_request.source_branch}'.
 
-          $(".remove_source_branch").on("ajax:error", function (e, data, status, xhr) {
-            $('.remove_source_branch_widget').hide();
-            $('.remove_source_branch_in_progress').hide();
-            $('.remove_source_branch_widget.failed').show();
-          });
-      - else
+      .remove_source_branch_in_progress.hide
         %p
-          The changes were merged into
-          #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}.
-        = render 'projects/merge_requests/widget/merged_buttons'
+          = icon('spinner spin')
+          Removing source branch '#{@merge_request.source_branch}'. Please wait, this page will be automatically reloaded.
+    - else
+      %p
+        The changes were merged into
+        #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}.
+      = render 'projects/merge_requests/widget/merged_buttons'
diff --git a/app/views/projects/merge_requests/widget/_merged_buttons.haml b/app/views/projects/merge_requests/widget/_merged_buttons.haml
index 56167509af97e75ad6bda88ef27b8a3f52f48c6d..d836a2535070f86db76500611509b50de4126492 100644
--- a/app/views/projects/merge_requests/widget/_merged_buttons.haml
+++ b/app/views/projects/merge_requests/widget/_merged_buttons.haml
@@ -3,9 +3,9 @@
 - mr_can_be_cherry_picked = @merge_request.can_be_cherry_picked?
 
 - if can_remove_source_branch || mr_can_be_reverted || mr_can_be_cherry_picked
-  .btn-group
+  .clearfix.merged-buttons
     - if can_remove_source_branch
-      = link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @merge_request.source_branch), remote: true, method: :delete, class: "btn btn-default btn-grouped btn-sm remove_source_branch" do
+      = link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @merge_request.source_branch), remote: true, method: :delete, class: "btn btn-default btn-sm remove_source_branch" do
         = icon('trash-o')
         Remove Source Branch
     - if mr_can_be_reverted