Update home settings, move avatar preview js to view
This commit is contained in:
parent
35457d42e9
commit
e36f492d4d
1
resources/assets/js/components.js
vendored
1
resources/assets/js/components.js
vendored
|
@ -43,7 +43,6 @@ require('./components/commentform');
|
|||
require('./components/searchform');
|
||||
require('./components/bookmarkform');
|
||||
require('./components/statusform');
|
||||
require('./components/settingspage');
|
||||
//require('./components/embed');
|
||||
//require('./components/notifications');
|
||||
|
||||
|
|
14
resources/assets/js/components/settingspage.js
vendored
14
resources/assets/js/components/settingspage.js
vendored
|
@ -1,14 +0,0 @@
|
|||
$(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);
|
||||
}
|
||||
});
|
||||
});
|
|
@ -131,5 +131,18 @@
|
|||
});
|
||||
|
||||
$('#maxAvatarSize').text(filesize({{config('pixelfed.max_avatar_size') * 1024}}, {round: 0}));
|
||||
|
||||
$('#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 mb-3" width="100%" height="100%"/>');
|
||||
}, false);
|
||||
|
||||
if (file) {
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
Loading…
Reference in a new issue