           analyticsService.event "View Task Comments", "Deleted existing comment"
         (response) ->
           alertService.add("danger", response.data.error, 2000)
+
+    $scope.scrollDown = () ->
+      $timeout (->
+        objDiv = document.getElementsByClassName("task-comments-viewer")
+        wrappedResult = angular.element(objDiv)
+        wrappedResult[0].scrollTop = wrappedResult[0].scrollHeight
+      )
 )

    project: "="
    task: "="
    comment: "=?"
  controller: ($scope, $modal, $state, TaskFeedback, TaskComment, Task, Project, taskService, alertService, projectService, analyticsService) ->
    #
    # Comment code
    #

        (success) ->
          $scope.comment.text = ""
          analyticsService.event "View Task Comments", "Added new comment"
          $scope.scrollDown()
        (response) ->
          alertService.add("danger", response.data.error, 2000)

