Update home settings, move avatar preview js to view

pull/773/head
Daniel Supernault 2019-01-10 20:40:29 -07:00
rodzic 35457d42e9
commit e36f492d4d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
3 zmienionych plików z 13 dodań i 15 usunięć

Wyświetl plik

@ -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');

Wyświetl plik

@ -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);
}
});
});

Wyświetl plik

@ -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