summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/labels_select.js.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/labels_select.js.coffee')
-rw-r--r--app/assets/javascripts/labels_select.js.coffee31
1 files changed, 10 insertions, 21 deletions
diff --git a/app/assets/javascripts/labels_select.js.coffee b/app/assets/javascripts/labels_select.js.coffee
index 1a802b81452..7688609b301 100644
--- a/app/assets/javascripts/labels_select.js.coffee
+++ b/app/assets/javascripts/labels_select.js.coffee
@@ -184,22 +184,20 @@ class @LabelsSelect
.value()
if $dropdown.hasClass 'js-extra-options'
- extraData = []
- if showAny
- extraData.push(
- isAny: true
- title: 'Any Label'
- )
-
if showNo
- extraData.push(
+ data.unshift(
id: 0
title: 'No Label'
)
- if extraData.length
- extraData.push 'divider'
- data = extraData.concat(data)
+ if showAny
+ data.unshift(
+ isAny: true
+ title: 'Any Label'
+ )
+
+ if data.length > 2
+ data.splice 2, 0, 'divider'
callback data
@@ -289,12 +287,6 @@ class @LabelsSelect
defaultLabel
fieldName: $dropdown.data('field-name')
id: (label) ->
- if $dropdown.hasClass('js-issuable-form-dropdown')
- if label.id is 0
- return
- else
- return label.id
-
if $dropdown.hasClass("js-filter-submit") and not label.isAny?
label.title
else
@@ -308,9 +300,6 @@ class @LabelsSelect
$selectbox.hide()
# display:block overrides the hide-collapse rule
$value.removeAttr('style')
-
- return if $dropdown.hasClass('js-issuable-form-dropdown')
-
if $dropdown.hasClass 'js-multiselect'
if $dropdown.hasClass('js-filter-submit') and (isIssueIndex or isMRIndex)
selectedLabels = $dropdown
@@ -332,7 +321,7 @@ class @LabelsSelect
clicked: (label) ->
_this.enableBulkLabelDropdown()
- if $dropdown.hasClass('js-filter-bulk-update') or $dropdown.hasClass('js-issuable-form-dropdown')
+ if $dropdown.hasClass('js-filter-bulk-update')
return
page = $('body').data 'page'