 
     checkMaximum: ->
       if @maximumReached()
+        @$wrapper.addClass 'disabled' if @$wrapper?
         @$input.prop('disabled', true)
       else
+        @$wrapper.removeClass 'disabled' if @$wrapper?
         @$input.prop('disabled', false)
 
     maximumReached: ->

      @files = @options.files

      @$form = @$input.closest('form')
      @$submit = @$form.find('input[type=submit]')

      @initFileUpload()
      @addFilesContainer()



    addFilesContainer: ->
      if @options.files_container_selector? and $(@options.files_container_selector).length > 0
        @$filesContainer = $(@options.files_container_selector)
      else
        @$filesContainer = $('<div class="attachinary_container">')
        @$input.after @$filesContainer

    redraw: ->
      @$filesContainer.empty()
