Fixed issuable sidebar label toggle not working
Removed un-used JS var
This commit is contained in:
parent
1920cf2d16
commit
44cf9e4cdf
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue