check if stats are loaded before redraw chart

stable
Juanfran 2014-11-12 08:14:38 +01:00
parent 81fd0486e3
commit c98996a8c5
1 changed files with 4 additions and 2 deletions

View File

@ -89,13 +89,15 @@ SprintGraphDirective = ->
element = angular.element($el)
$scope.$on "resize", ->
redrawChart(element, $scope.stats.days)
redrawChart(element, $scope.stats.days) if $scope.stats
$scope.$on "taskboard:graph:toggle-visibility", ->
$el.parent().toggleClass('open')
# fix chart overflow
timeout(100, -> redrawChart(element, $scope.stats.days))
timeout(100, ->
redrawChart(element, $scope.stats.days) if $scope.stats
)
$scope.$watch 'stats', (value) ->
if not $scope.stats?