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
|
else
|
||||||
selectedObject
|
selectedObject
|
||||||
else
|
else
|
||||||
if !value?
|
if not @options.multiSelect or el.hasClass('dropdown-clear-active')
|
||||||
field.remove()
|
|
||||||
|
|
||||||
if not @options.multiSelect
|
|
||||||
@dropdown.find(".#{ACTIVE_CLASS}").removeClass ACTIVE_CLASS
|
@dropdown.find(".#{ACTIVE_CLASS}").removeClass ACTIVE_CLASS
|
||||||
@dropdown.parent().find("input[name='#{fieldName}']").remove()
|
@dropdown.parent().find("input[name='#{fieldName}']").remove()
|
||||||
|
|
||||||
|
if !value?
|
||||||
|
field.remove()
|
||||||
|
|
||||||
# Toggle active class for the tick mark
|
# Toggle active class for the tick mark
|
||||||
el.addClass ACTIVE_CLASS
|
el.addClass ACTIVE_CLASS
|
||||||
|
|
||||||
|
|
|
@ -201,16 +201,21 @@ class @LabelsSelect
|
||||||
callback data
|
callback data
|
||||||
|
|
||||||
renderRow: (label) ->
|
renderRow: (label) ->
|
||||||
selectedClass = ''
|
removesAll = label.id is 0 or label.id is undefined
|
||||||
|
|
||||||
|
selectedClass = []
|
||||||
if $form.find("input[type='hidden']\
|
if $form.find("input[type='hidden']\
|
||||||
[name='#{$dropdown.data('fieldName')}']\
|
[name='#{$dropdown.data('fieldName')}']\
|
||||||
[value='#{this.id(label)}']").length
|
[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 ""
|
color = if label.color? then "<span class='dropdown-label-box' style='background-color: #{label.color}'></span>" else ""
|
||||||
|
|
||||||
"<li>
|
"<li>
|
||||||
<a href='#' class='#{selectedClass}'>
|
<a href='#' class='#{selectedClass.join(' ')}'>
|
||||||
#{color}
|
#{color}
|
||||||
#{label.title}
|
#{label.title}
|
||||||
</a>
|
</a>
|
||||||
|
@ -237,9 +242,7 @@ class @LabelsSelect
|
||||||
defaultLabel
|
defaultLabel
|
||||||
fieldName: $dropdown.data('field-name')
|
fieldName: $dropdown.data('field-name')
|
||||||
id: (label) ->
|
id: (label) ->
|
||||||
if label.isAny?
|
if $dropdown.hasClass("js-filter-submit") and not label.isAny?
|
||||||
''
|
|
||||||
else if $dropdown.hasClass "js-filter-submit"
|
|
||||||
label.title
|
label.title
|
||||||
else
|
else
|
||||||
label.id
|
label.id
|
||||||
|
|
|
@ -117,7 +117,7 @@ class IssuableFinder
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_by_no_label?
|
def filter_by_no_label?
|
||||||
labels? && params[:label_name] == Label::None.title
|
labels? && params[:label_name].include?(Label::None.title)
|
||||||
end
|
end
|
||||||
|
|
||||||
def labels
|
def labels
|
||||||
|
|
Loading…
Reference in New Issue