8dc7efb2b0
Prioritize and simplify project settings content.
16 lines
536 B
JavaScript
16 lines
536 B
JavaScript
import $ from 'jquery';
|
|
|
|
export default function initAvatarPicker() {
|
|
$('.js-choose-avatar-button').on('click', function onClickAvatar() {
|
|
const form = $(this).closest('form');
|
|
return form.find('.js-avatar-input').click();
|
|
});
|
|
|
|
$('.js-avatar-input').on('change', function onChangeAvatarInput() {
|
|
const form = $(this).closest('form');
|
|
const filename = $(this)
|
|
.val()
|
|
.replace(/^.*[\\\/]/, ''); // eslint-disable-line no-useless-escape
|
|
return form.find('.js-avatar-filename').text(filename);
|
|
});
|
|
}
|