       if parseInt(document.id) == parseInt(id)
         document.remove = true
         @$("#file-uploaded-file-#{id}").remove()
+        @onCancel()
     return false

  onProgress: () =>
    @onProgressCallback() if @onProgressCallback

  onSubmit: (id, fileName) =>
    obj = {id: id, name: fileName}

    _.bindAll(this, 'render')
    @documents = []
    @onComplete = @options.onComplete if @options.onComplete
    @onCancel = @options.onCancel if @options.onCancel
    @onProgressCallback = @options.onProgress if @options.onProgress
    @documents = @options.documents if @options.documents
    @allowedExtensions = @options.allowedExtensions if @options.allowedExtensions?
