This commit is contained in:
Alfredo Sumaran 2016-04-26 14:34:19 -05:00
parent 4ab6bfcef5
commit 6974d970b4
3 changed files with 13 additions and 18 deletions

View File

@ -11,7 +11,7 @@ class GitLabDropdownFilter
$inputContainer = @input.parent()
$clearButton = $inputContainer.find('.js-dropdown-input-clear')
@indeterminatedIds = []
@indeterminateIds = []
# Clear click
$clearButton.on 'click', (e) =>
@ -300,10 +300,10 @@ class GitLabDropdown
opened: =>
@addArrowKeyEvent()
if @options.setIndeterminatedIds
@options.setIndeterminatedIds.call(@)
if @options.setIndeterminateIds
@options.setIndeterminateIds.call(@)
# Makes indeterminated items effective
# Makes indeterminate items effective
if @fullData and @dropdown.find('.dropdown-menu-toggle').hasClass('js-filter-bulk-update')
@parseData @fullData

View File

@ -203,20 +203,15 @@ class @LabelsSelect
removesAll = label.id is 0 or not label.id?
if $dropdown.hasClass('js-filter-bulk-update')
indeterminated = instance.indeterminatedIds
if indeterminated.indexOf(label.id) isnt -1
selectedClass.push 'indeterminated'
indeterminate = instance.indeterminateIds
if indeterminate.indexOf(label.id) isnt -1
selectedClass.push 'indeterminate'
if $form.find("input[type='hidden']\
[name='#{$dropdown.data('fieldName')}']\
[value='#{this.id(label)}']").length
selectedClass.push 'is-active'
index = selectedClass.indexOf('indeterminated')
if index isnt -1
selectedClass.splice(index, 1)
if $dropdown.hasClass('js-multiselect') and removesAll
selectedClass.push 'dropdown-clear-active'
@ -316,13 +311,13 @@ class @LabelsSelect
else
saveLabelData()
setIndeterminatedIds: ->
setIndeterminateIds: ->
if @dropdown.find('.dropdown-menu-toggle').hasClass('js-filter-bulk-update')
console.log 'options.setIndeterminatedIds'
@indeterminatedIds = _this.getIndeterminatedIds()
console.log 'options.setIndeterminateIds'
@indeterminateIds = _this.getIndeterminateIds()
)
getIndeterminatedIds: ->
getIndeterminateIds: ->
label_ids = []
$('.selected_issue:checked').each (i, el) ->

View File

@ -232,7 +232,7 @@
a {
padding-left: 25px;
&.indeterminated, &.is-active{
&.indeterminate, &.is-active{
&::before {
position: absolute;
left: 5px;
@ -246,7 +246,7 @@
}
}
&.indeterminated::before {
&.indeterminate::before {
content: "\f068";
}