diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-05-05 17:10:12 -0500 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-06-03 17:14:23 -0500 |
commit | f02ee98697ba2829bf092d662c24e2e553832fe9 (patch) | |
tree | 8478bb17e10812c1dfa4a2ce917d1927cc2ca733 /app | |
parent | 151158f1d775de477a767fd93c34197d9349cd1a (diff) | |
download | gitlab-ce-f02ee98697ba2829bf092d662c24e2e553832fe9.tar.gz |
Tweaks for bulk assignment
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/labels_select.js.coffee | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/app/assets/javascripts/labels_select.js.coffee b/app/assets/javascripts/labels_select.js.coffee index 52c1e8a469b..eb249e24f67 100644 --- a/app/assets/javascripts/labels_select.js.coffee +++ b/app/assets/javascripts/labels_select.js.coffee @@ -237,13 +237,23 @@ class @LabelsSelect else colorEl = '' + # We need to identify which items are actually labels + labelIdHtml = labelClass = '' + + if label.id + # Add label id only for labels + labelIdHtml = "data-label-id='#{label.id}'" + + # Add class only for labels + labelClass = 'label-item' + "<li> - <a href='#' class='#{selectedClass.join(' ')}'> + <a href='#' #{labelIdHtml} class='#{labelClass} #{selectedClass.join(' ')}'> #{colorEl} #{_.escape(label.title)} </a> </li>" - filterable: true + persistWhenHide: $dropdown.data('persistWhenHide') search: fields: ['title'] selectable: true @@ -291,7 +301,9 @@ class @LabelsSelect saveLabelData() if $dropdown.hasClass('js-filter-bulk-update') - $dropdown.parent().find('.is-active, .is-indeterminate').removeClass() + # If we are persisting state we need the classes + if not @options.persistWhenHide + $dropdown.parent().find('.is-active, .is-indeterminate').removeClass() multiSelect: $dropdown.hasClass 'js-multiselect' clicked: (label) -> |