Any label & no label out weigh other labels - these two will clear previously selected labels
Fixed issue with no label not working correctly
This commit is contained in:
parent
75626d5f01
commit
439a72803b
|
@ -389,13 +389,13 @@ class GitLabDropdown
|
|||
else
|
||||
selectedObject
|
||||
else
|
||||
if !value?
|
||||
field.remove()
|
||||
|
||||
if not @options.multiSelect
|
||||
if not @options.multiSelect or el.hasClass('dropdown-clear-active')
|
||||
@dropdown.find(".#{ACTIVE_CLASS}").removeClass ACTIVE_CLASS
|
||||
@dropdown.parent().find("input[name='#{fieldName}']").remove()
|
||||
|
||||
if !value?
|
||||
field.remove()
|
||||
|
||||
# Toggle active class for the tick mark
|
||||
el.addClass ACTIVE_CLASS
|
||||
|
||||
|
|
|
@ -201,16 +201,21 @@ class @LabelsSelect
|
|||
callback data
|
||||
|
||||
renderRow: (label) ->
|
||||
selectedClass = ''
|
||||
removesAll = label.id is 0 or label.id is undefined
|
||||
|
||||
selectedClass = []
|
||||
if $form.find("input[type='hidden']\
|
||||
[name='#{$dropdown.data('fieldName')}']\
|
||||
[value='#{this.id(label)}']").length
|
||||
selectedClass = 'is-active'
|
||||
selectedClass.push 'is-active'
|
||||
|
||||
if $dropdown.hasClass('js-multiselect') and removesAll
|
||||
selectedClass.push 'dropdown-clear-active'
|
||||
|
||||
color = if label.color? then "<span class='dropdown-label-box' style='background-color: #{label.color}'></span>" else ""
|
||||
|
||||
"<li>
|
||||
<a href='#' class='#{selectedClass}'>
|
||||
<a href='#' class='#{selectedClass.join(' ')}'>
|
||||
#{color}
|
||||
#{label.title}
|
||||
</a>
|
||||
|
@ -237,9 +242,7 @@ class @LabelsSelect
|
|||
defaultLabel
|
||||
fieldName: $dropdown.data('field-name')
|
||||
id: (label) ->
|
||||
if label.isAny?
|
||||
''
|
||||
else if $dropdown.hasClass "js-filter-submit"
|
||||
if $dropdown.hasClass("js-filter-submit") and not label.isAny?
|
||||
label.title
|
||||
else
|
||||
label.id
|
||||
|
|
|
@ -117,7 +117,7 @@ class IssuableFinder
|
|||
end
|
||||
|
||||
def filter_by_no_label?
|
||||
labels? && params[:label_name] == Label::None.title
|
||||
labels? && params[:label_name].include?(Label::None.title)
|
||||
end
|
||||
|
||||
def labels
|
||||
|
|
Loading…
Reference in New Issue