debian-mirror-gitlab/app/assets/javascripts/project_avatar.js
2016-09-13 17:45:13 +05:30

21 lines
606 B
JavaScript

(function() {
this.ProjectAvatar = (function() {
function ProjectAvatar() {
$('.js-choose-project-avatar-button').bind('click', function() {
var form;
form = $(this).closest('form');
return form.find('.js-project-avatar-input').click();
});
$('.js-project-avatar-input').bind('change', function() {
var filename, form;
form = $(this).closest('form');
filename = $(this).val().replace(/^.*[\\\/]/, '');
return form.find('.js-avatar-filename').text(filename);
});
}
return ProjectAvatar;
})();
}).call(this);