Fix a bug in the backlog filters when unselect one in a secction with different type
parent
98f90f91cf
commit
9252ef8a51
|
@ -77,11 +77,12 @@ BacklogFiltersDirective = ($log, $location) ->
|
|||
$ctrl = $el.closest(".wrapper").controller()
|
||||
selectedFilters = []
|
||||
|
||||
showFilters = (title) ->
|
||||
showFilters = (title, type) ->
|
||||
$el.find(".filters-cats").hide()
|
||||
$el.find(".filter-list").show()
|
||||
$el.find("h2 a.subfilter").removeClass("hidden")
|
||||
$el.find("h2 a.subfilter span.title").html(title)
|
||||
$el.find("h2 a.subfilter span.title").prop("data-type", type)
|
||||
|
||||
showCategories = ->
|
||||
$el.find(".filters-cats").show()
|
||||
|
@ -119,6 +120,9 @@ BacklogFiltersDirective = ($log, $location) ->
|
|||
$ctrl.filterVisibleUserstories()
|
||||
|
||||
renderSelectedFilters(selectedFilters)
|
||||
|
||||
currentFiltersType = $el.find("h2 a.subfilter span.title").prop('data-type')
|
||||
if type == currentFiltersType
|
||||
renderFilters(_.reject(filters, "selected"))
|
||||
|
||||
selectSubjectFilter = debounce 400, (value) ->
|
||||
|
@ -131,27 +135,26 @@ BacklogFiltersDirective = ($log, $location) ->
|
|||
|
||||
$scope.$watch("filtersSubject", selectSubjectFilter)
|
||||
|
||||
# Angular Watchers
|
||||
## Angular Watchers
|
||||
$scope.$on "filters:loaded", (ctx, filters) ->
|
||||
initializeSelectedFilters(filters)
|
||||
|
||||
# Dom Event Handlers
|
||||
## Dom Event Handlers
|
||||
$el.on "click", ".filters-cats > ul > li > a", (event) ->
|
||||
event.preventDefault()
|
||||
target = angular.element(event.currentTarget)
|
||||
tags = $scope.filters[target.data("type")]
|
||||
|
||||
renderFilters(_.reject(tags, "selected"))
|
||||
showFilters(target.attr("title"))
|
||||
showFilters(target.attr("title"), target.data("type"))
|
||||
|
||||
$el.on "click", ".filters-inner > h1 > a.title", (event) ->
|
||||
event.preventDefault()
|
||||
showCategories($el)
|
||||
showCategories()
|
||||
|
||||
$el.on "click", ".filters-applied a", (event) ->
|
||||
event.preventDefault()
|
||||
target = angular.element(event.currentTarget)
|
||||
|
||||
id = target.data("id")
|
||||
type = target.data("type")
|
||||
toggleFilterSelection(type, id)
|
||||
|
|
Loading…
Reference in New Issue