       @dialog.html(submissionDetailsDialog(@submission))
       @dialog.find('select').trigger('change')
       @scrollCommentsToBottom()
-    
+
     @cachedDialogs: {}
 
     @open: (assignment, student, options) ->

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



    open: =>
      @dialog.dialog('open')

    scrollCommentsToBottom: =>
      @dialog.find('.submission_details_comments').scrollTop(999999)

    update: (newData) =>
      $.extend @submission, newData
      @submission.submission_history[0] = @submission
