summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-07-18 08:43:39 +0100
committerPhil Hughes <me@iamphill.com>2016-07-20 10:48:02 +0100
commitc48476646eb07ab5d682fcf0fb7b3255aa16bf1d (patch)
treed4c3300707ee6368f2e80bb7d629520b351d3e89
parentc9cd271536fdbef3ad07d15978bada5f4a440d7f (diff)
downloadgitlab-ce-c48476646eb07ab5d682fcf0fb7b3255aa16bf1d.tar.gz
Fixed issuable sidebar label dropdown
-rw-r--r--app/views/shared/issuable/_sidebar.html.haml3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml
index 61fb1bd1642..61a096d7bf1 100644
--- a/app/views/shared/issuable/_sidebar.html.haml
+++ b/app/views/shared/issuable/_sidebar.html.haml
@@ -125,12 +125,13 @@
- else
%span.no-value None
.selectbox.hide-collapsed
+ - selected_labels = params["#{issuable.to_ability_name}[label_names]"].to_a
- issuable.labels_array.each do |label|
= hidden_field_tag "#{issuable.to_ability_name}[label_names][]", label.id, id: nil, data: { title: label.title }
.dropdown
%button.dropdown-menu-toggle.js-label-select.js-multiselect{type: "button", data: {toggle: "dropdown", default_label: "Labels", field_name: "#{issuable.to_ability_name}[label_names][]", ability_name: issuable.to_ability_name, show_no: "true", show_any: "true", project_id: (@project.id if @project), issue_update: issuable_json_path(issuable), labels: (namespace_project_labels_path(@project.namespace, @project, :json) if @project)}}
%span.dropdown-toggle-text{ class: ("is-default" if issuable.labels_array.empty?)}
- = multi_label_name(issuable.labels_array, "Labels")
+ = multi_label_name(issuable.labels_array, h(selected_labels[0]), "Labels")
= icon('chevron-down')
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
= render partial: "shared/issuable/label_page_default"