mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-21 04:23:16 +00:00
15 lines
455 B
JavaScript
15 lines
455 B
JavaScript
|
$(document).ready(function () {
|
||
|
$('#avatarInput').on('change', function(e) {
|
||
|
var file = document.getElementById('avatarInput').files[0];
|
||
|
var reader = new FileReader();
|
||
|
|
||
|
reader.addEventListener("load", function() {
|
||
|
$('#previewAvatar').html('<img src="' + reader.result + '" class="rounded-circle box-shadow" />');
|
||
|
}, false);
|
||
|
|
||
|
if (file) {
|
||
|
reader.readAsDataURL(file);
|
||
|
}
|
||
|
});
|
||
|
});
|