diff --git a/app/coffee/modules/controllerMixins.coffee b/app/coffee/modules/controllerMixins.coffee index 588e7c4e..b7d1af25 100644 --- a/app/coffee/modules/controllerMixins.coffee +++ b/app/coffee/modules/controllerMixins.coffee @@ -55,7 +55,7 @@ class FiltersMixin selectFilter: (name, value, load=false) -> params = @location.search() if params[name] != undefined and name != "page" - existing = _.map(taiga.toString(params[name]).split(","), trim) + existing = _.map(taiga.toString(params[name]).split(","), (x) -> trim(x)) existing.push(taiga.toString(value)) existing = _.compact(existing) value = joinStr(",", _.uniq(existing)) @@ -76,7 +76,7 @@ class FiltersMixin if value is undefined or value is null delete params[name] - parsedValues = _.map(taiga.toString(params[name]).split(","), trim) + parsedValues = _.map(taiga.toString(params[name]).split(","), (x) -> trim(x)) newValues = _.reject(parsedValues, (x) -> x == taiga.toString(value)) newValues = _.compact(newValues) diff --git a/app/coffee/modules/issues/list.coffee b/app/coffee/modules/issues/list.coffee index 2cd87a9f..e520fd43 100644 --- a/app/coffee/modules/issues/list.coffee +++ b/app/coffee/modules/issues/list.coffee @@ -386,6 +386,11 @@ IssuesFiltersDirective = ($log, $location) -> filters = $scope.filters[type] filter = _.find(filters, {id:id}) filter.selected = (not filter.selected) + + # Convert id to null as string for properly + # put null value on url parameters + id = "null" if id is null + if filter.selected selectedFilters.push(filter) $scope.$apply -> @@ -433,7 +438,7 @@ IssuesFiltersDirective = ($log, $location) -> event.preventDefault() target = angular.element(event.currentTarget) - id = target.data("id") + id = target.data("id") or null type = target.data("type") toggleFilterSelection(type, id) @@ -442,11 +447,10 @@ IssuesFiltersDirective = ($log, $location) -> target = angular.element(event.currentTarget) if target.hasClass("active") target.removeClass("active") - # target.css("background-color") else target.addClass("active") - id = target.data("id") + id = target.data("id") or null type = target.data("type") toggleFilterSelection(type, id)