summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-07-18 17:56:05 +0100
committerPhil Hughes <me@iamphill.com>2016-07-20 10:48:02 +0100
commit44cf9e4cdf53402ee583c46a478c7fbcd551a97f (patch)
tree625855876c431f09f550d285207cd15e1f33d1be /app
parent1920cf2d161534ae7d8fca8ba6ade50d56d0b391 (diff)
downloadgitlab-ce-44cf9e4cdf53402ee583c46a478c7fbcd551a97f.tar.gz
Fixed issuable sidebar label toggle not working
Removed un-used JS var
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/labels_select.js.coffee2
-rw-r--r--app/assets/javascripts/users_select.js.coffee2
-rw-r--r--app/views/shared/issuable/_sidebar.html.haml4
3 files changed, 4 insertions, 4 deletions
diff --git a/app/assets/javascripts/labels_select.js.coffee b/app/assets/javascripts/labels_select.js.coffee
index ab1384c1bf9..8e7dee46fa6 100644
--- a/app/assets/javascripts/labels_select.js.coffee
+++ b/app/assets/javascripts/labels_select.js.coffee
@@ -26,7 +26,7 @@ class @LabelsSelect
$colorPreview = $('.js-dropdown-label-color-preview')
$newLabelCreateButton = $('.js-new-label-btn')
fieldName = $dropdown.data('field-name')
- useId = $dropdown.hasClass('js-issuable-form-dropdown') or $dropdown.hasClass('js-filter-bulk-update')
+ useId = $dropdown.is('.js-issuable-form-dropdown, .js-filter-bulk-update, .js-label-sidebar-dropdown')
propertyName = if useId then "id" else "title"
$newLabelError.hide()
diff --git a/app/assets/javascripts/users_select.js.coffee b/app/assets/javascripts/users_select.js.coffee
index 1c5a0dc108f..cb1bf2c8154 100644
--- a/app/assets/javascripts/users_select.js.coffee
+++ b/app/assets/javascripts/users_select.js.coffee
@@ -142,7 +142,7 @@ class @UsersSelect
selectable: true
fieldName: $dropdown.data('field-name')
- toggleLabel: (selected, el, e) ->
+ toggleLabel: (selected, el) ->
if selected and 'id' of selected and $(el).hasClass('is-active')
if selected.text then selected.text else selected.name
else
diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml
index 61a096d7bf1..8fab7a41b81 100644
--- a/app/views/shared/issuable/_sidebar.html.haml
+++ b/app/views/shared/issuable/_sidebar.html.haml
@@ -127,9 +127,9 @@
.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 }
+ = hidden_field_tag "#{issuable.to_ability_name}[label_names][]", label.id, id: nil
.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.js-label-sidebar-dropdown{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, h(selected_labels[0]), "Labels")
= icon('chevron-down')