diff --git a/resources/assets/js/components.js b/resources/assets/js/components.js index c821c06ed..084325fcf 100644 --- a/resources/assets/js/components.js +++ b/resources/assets/js/components.js @@ -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'); diff --git a/resources/assets/js/components/settingspage.js b/resources/assets/js/components/settingspage.js deleted file mode 100644 index 190e22a7b..000000000 --- a/resources/assets/js/components/settingspage.js +++ /dev/null @@ -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(''); - }, false); - - if (file) { - reader.readAsDataURL(file); - } - }); -}); diff --git a/resources/views/settings/home.blade.php b/resources/views/settings/home.blade.php index d12fc182b..c81d70c9f 100644 --- a/resources/views/settings/home.blade.php +++ b/resources/views/settings/home.blade.php @@ -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(''); + }, false); + + if (file) { + reader.readAsDataURL(file); + } + }); @endpush