 
     @scope.$on '$destroy', @_cleanUp
 
-    @_scrollToViolations() if @scope.$parent.prevHash == '#!/violations'
+    @_scrollToViolations() if @scope.$parent.prevHash == @NamedRouteService.reverse('violations')
 
   _scrollToElement: (el) =>
     srcollY = el[0].offsetTop + parseInt(el.css('margin-top'), 10) / 2

'use strict'

class DomainsCtrl
  constructor: (@scope, @window, @interval, @DomainsFcty, @MostCommonViolationsFcty, @WebSocketFcty) ->
    @domainsVisible = false
    @groupsVisible = true
    @mostFrequentVisible = false



angular.module('holmesApp')
  .controller 'DomainsCtrl', ($scope, $window, $interval, DomainsFcty, MostCommonViolationsFcty, WebSocketFcty, $NamedRouteService) ->

    $scope.model = new DomainsCtrl($scope, $window, $interval, DomainsFcty, MostCommonViolationsFcty, WebSocketFcty, $NamedRouteService)
