diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-09-27 14:08:45 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-09-27 14:08:45 +0000 |
commit | 3820ca5876ecb550d4d7eba0db98296f467125d8 (patch) | |
tree | 613977d866fd51375c6582a31d6726ae24931c29 /app/assets/javascripts | |
parent | bc452eafea8dfd32ea1b132c04fc22a38fa71d5c (diff) | |
parent | 78839ec0fe146564a4a4a2ab339f479e25a13e5e (diff) | |
download | gitlab-ce-3820ca5876ecb550d4d7eba0db98296f467125d8.tar.gz |
Merge branch 'issue-boards-label-filter-fix' into 'master'
Fixed issue board label filtering not removing labels
## What does this MR do?
When trying to remove a label filter it would actually add it instead making it impossible to remove the label filter without modifying the URL. This fixes that by correctly removing the label from the filter.
## What are the relevant issue numbers?
Closes #21417
See merge request !6208
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/labels_select.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/labels_select.js b/app/assets/javascripts/labels_select.js index 3f15a117ca8..c562b7d7b00 100644 --- a/app/assets/javascripts/labels_select.js +++ b/app/assets/javascripts/labels_select.js @@ -280,12 +280,12 @@ if (page === 'projects:boards:show') { if (label.isAny) { gl.issueBoards.BoardsStore.state.filters['label_name'] = []; - } else if (label.title) { + } else if ($el.hasClass('is-active')) { gl.issueBoards.BoardsStore.state.filters['label_name'].push(label.title); } else { var filters = gl.issueBoards.BoardsStore.state.filters['label_name']; - filters = filters.filter(function (label) { - return label !== $el.text().trim(); + filters = filters.filter(function (filteredLabel) { + return filteredLabel !== label.title; }); gl.issueBoards.BoardsStore.state.filters['label_name'] = filters; } |