 
     # Set defaults
     {
-      @filename
+      @form = @fileInput.parents('form')
+      @filename = '.js-avatar-filename'
       @previewImage = $('.avatar-image .avatar')
-      @form = @fileInput.parents('form')
       @modalCrop = '.modal-profile-crop'
       @exportWidth = 200
       @exportHeight = 200


  setPreview: ->
    @previewImage.attr('src', @dataURL)

  setBlob: ->
    @dataURL = @modalCropImg.cropper('getCroppedCanvas',

      @uploadImageBtn = $('.js-upload-user-avatar')
    } = opts

    # Ensure needed elements are jquery objects
    @filename = if _.isString(@filename) then @$(@filename) else @filename

    # Modal usually is outside the wrapper element
    @modalCrop = if _.isString(@modalCrop) then $(@modalCrop) else @modalCrop

    @modalCropImg = $('.modal-profile-crop-image')
    @cropActionsBtn = @modalCrop.find('[data-method]')

    @bindEvents()

  $: (selector) ->
    $(selector, @form)

  bindEvents: ->
    self = @
