[backport] remove repeated api calls

stable
Juanfran 2015-12-01 09:22:23 +01:00
parent 40c3b71dfd
commit 026367985a
1 changed files with 7 additions and 4 deletions

View File

@ -168,7 +168,7 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
for obj in value
obj.selected = if isSelected(obj.type, obj.id) then true else undefined
loadFilters: ->
loadFilters: () ->
urlfilters = @.getUrlFilters()
if urlfilters.q
@ -561,8 +561,8 @@ IssuesFiltersDirective = ($q, $log, $location, $rs, $confirm, $loading, $templat
html = $compile(html)($scope)
$el.find(".filter-list").html(html)
selectQFilter = debounceLeading 100, (value) ->
return if value is undefined
selectQFilter = debounceLeading 100, (value, oldValue) ->
return if value is undefined or value == oldValue
$ctrl.replaceFilter("page", null, true)
@ -575,7 +575,10 @@ IssuesFiltersDirective = ($q, $log, $location, $rs, $confirm, $loading, $templat
reloadIssues()
$scope.$watch("filtersQ", selectQFilter)
unwatchIssues = $scope.$watch "issues", (newValue) ->
if !_.isUndefined(newValue)
$scope.$watch("filtersQ", selectQFilter)
unwatchIssues()
# Dom Event Handlers
$el.on "click", ".filters-cats > ul > li > a", (event) ->