summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Shea <connor.james.shea@gmail.com>2016-08-01 13:56:56 -0600
committerConnor Shea <connor.james.shea@gmail.com>2016-08-17 09:23:43 -0600
commit41d598ce5004d23c6af7961284cfd9055297ba09 (patch)
tree1d814ca67310e7ab14ca6647560362cd9c141ec6
parent83bbca26f48242461606f76f69f3e3bb462666d0 (diff)
downloadgitlab-ce-41d598ce5004d23c6af7961284cfd9055297ba09.tar.gz
Initial implementation of an async branch dropdown for Revert and Cherry Pick.
-rw-r--r--app/assets/stylesheets/framework/modal.scss1
-rw-r--r--app/controllers/projects/branches_controller.rb7
-rw-r--r--app/views/projects/commit/_change.html.haml9
3 files changed, 15 insertions, 2 deletions
diff --git a/app/assets/stylesheets/framework/modal.scss b/app/assets/stylesheets/framework/modal.scss
index 26ad2870aa0..8374f30d0b2 100644
--- a/app/assets/stylesheets/framework/modal.scss
+++ b/app/assets/stylesheets/framework/modal.scss
@@ -1,6 +1,5 @@
.modal-body {
position: relative;
- overflow-y: auto;
padding: 15px;
.form-actions {
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index 48fe81b0d74..462d4e461e1 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -15,6 +15,13 @@ class Projects::BranchesController < Projects::ApplicationController
diverging_commit_counts = repository.diverging_commit_counts(branch)
[memo, diverging_commit_counts[:behind], diverging_commit_counts[:ahead]].max
end
+
+ respond_to do |format|
+ format.html
+ format.json do
+ render json: @repository.branch_names.to_json
+ end
+ end
end
def recent
diff --git a/app/views/projects/commit/_change.html.haml b/app/views/projects/commit/_change.html.haml
index d9b800a4ded..f5407bdbc7b 100644
--- a/app/views/projects/commit/_change.html.haml
+++ b/app/views/projects/commit/_change.html.haml
@@ -17,7 +17,14 @@
.form-group.branch
= label_tag 'target_branch', target_label, class: 'control-label'
.col-sm-10
- = select_tag "target_branch", project_branches, class: "select2 select2-sm js-target-branch"
+ .dropdown
+ = dropdown_toggle @project.default_branch, { toggle: "dropdown", selected: @project.default_branch, ref: @ref, refs_url: branches_namespace_project_path(@project.namespace, @project) }, { toggle_class: "js-project-refs-dropdown js-target-branch" }
+ .dropdown-menu.dropdown-menu-selectable
+ = dropdown_title "Switch branch"
+ = dropdown_filter "Search branches"
+ = dropdown_content
+ = dropdown_loading
+
- if can?(current_user, :push_code, @project)
.js-create-merge-request-container
.checkbox