debian-mirror-gitlab/app/assets/javascripts/project_avatar.js.coffee

10 lines
386 B
CoffeeScript
Raw Normal View History

2015-04-26 12:48:37 +05:30
class @ProjectAvatar
constructor: ->
$('.js-choose-project-avatar-button').bind 'click', ->
form = $(this).closest('form')
form.find('.js-project-avatar-input').click()
$('.js-project-avatar-input').bind 'change', ->
form = $(this).closest('form')
filename = $(this).val().replace(/^.*[\\\/]/, '')
form.find('.js-avatar-filename').text(filename)