Commit 0debd9c7 authored by Arinde Eniola's avatar Arinde Eniola

fix labels button dropdown not showing how many labels clicked

parent 0c61f052
......@@ -220,9 +220,19 @@ class @LabelsSelect
fields: ['title']
selectable: true
toggleLabel: (selected) ->
toggleLabel: (selected, el) ->
selected_labels = $('.js-label-select').siblings('.dropdown-menu-labels').find('.is-active')
if selected and selected.title?
if selected_labels and selected_labels.length > 1
"#{selected.title} +#{selected_labels.length - 1} more"
else
selected.title
else if not selected and selected_labels.length isnt 0
if selected_labels.length > 1
"#{$(selected_labels[0]).text()} +#{selected_labels.length - 1} more"
else if selected_labels.length is 1
$(selected_labels).text()
else
defaultLabel
fieldName: $dropdown.data('field-name')
......
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