Sha256: 76c993c408209eddd60de39529178b034631293f5480afadc75abf0ca8a447c4

Contents?: true

Size: 568 Bytes

Versions: 5

Compression:

Stored size: 568 Bytes

Contents

document.addEventListener 'turbolinks:load', ->
  $ ->
    $('#add-user-avatar').fileupload
      url: '/add_user_avatar'
      dataType: 'json'
      sequentialUploads: true
      multipart: true
      paramName: 'avatar[uploaded_file]'
      fail: (e, data) ->
        console.log(e)
        console.log(data)
      done: (e, data) ->
        if data.result.state == 'ok'
          $('#state-img').remove()
          $('#user-avatar').empty()
          $('#user-avatar').prepend('<img class="user-avatar__img img-present" src="' + data.result.picture['src'] + '"/>')

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
digital_heroes_startkit-0.1.1.4 app/assets/javascripts/avatar.coffee
digital_heroes_startkit-0.1.1.3 app/assets/javascripts/avatar.coffee
digital_heroes_startkit-0.1.1.2 app/assets/javascripts/avatar.coffee
digital_heroes_startkit-0.1.1.1 app/assets/javascripts/avatar.coffee
digital_heroes_startkit-0.1.1 app/assets/javascripts/avatar.coffee