preselection d'un nouveau avatar

This commit is contained in:
afornerot 2021-03-16 11:13:07 +01:00
parent 4c707c5899
commit 569f3a5860

View File

@ -49,5 +49,24 @@
$(window).load(function () {
$('#largeimg').imgAreaSelect({ aspectRatio: '1:1', onSelectChange: preview });
var selection = new Object();
if($('#largeimg').height()<$('#largeimg').width()) {
selection.width = $('#largeimg').height();
selection.height = $('#largeimg').height();
}
else {
selection.width = $('#largeimg').width();
selection.height = $('#largeimg').width();
}
selection.x1=0;
selection.x2=0;
selection.y1=0;
selection.y2=0;
preview($('#largeimg'),selection);
});
{% endblock %}