Commit c4847664 authored by Phil Hughes's avatar Phil Hughes

Fixed issuable sidebar label dropdown

parent c9cd2715
...@@ -125,12 +125,13 @@ ...@@ -125,12 +125,13 @@
- else - else
%span.no-value None %span.no-value None
.selectbox.hide-collapsed .selectbox.hide-collapsed
- selected_labels = params["#{issuable.to_ability_name}[label_names]"].to_a
- issuable.labels_array.each do |label| - issuable.labels_array.each do |label|
= hidden_field_tag "#{issuable.to_ability_name}[label_names][]", label.id, id: nil, data: { title: label.title } = hidden_field_tag "#{issuable.to_ability_name}[label_names][]", label.id, id: nil, data: { title: label.title }
.dropdown .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)}} %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?)} %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') = icon('chevron-down')
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable .dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
= render partial: "shared/issuable/label_page_default" = render partial: "shared/issuable/label_page_default"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment