 
     open: =>
       @dialog.dialog('open')
-    
+
     scrollCommentsToBottom: =>
       @dialog.find('.submission_details_comments').scrollTop(999999)
-      
+
     update: (newData) =>
       $.extend @submission, newData
       @submission.submission_history[0] = @submission

  class SubmissionDetailsDialog
    constructor: (@assignment, @student, @options) ->
      @url = @options.change_grade_url.replace(":assignment", @assignment.id).replace(":submission", @student.id)
      @submission = $.extend {}, @student["assignment_#{@assignment.id}"], 
        assignment: @assignment
        speedGraderUrl: "#{@options.context_url}/gradebook/speed_grader?assignment_id=#{@assignment.id}#%7B%22student_id%22%3A#{@student.id}%7D"
        loading: true

          event.preventDefault()
          $(event.currentTarget).disableWhileLoading $.ajaxJSON @url, 'PUT', $(event.currentTarget).getFormData(), (data) =>
            @update(data)
            setTimeout =>
              @dialog.dialog('close')
            , 500

