Prevent flashing the full sized image when cropping an avatar
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
ed4ed7911a
commit
5a44b70efc
1 changed files with 5 additions and 2 deletions
|
@ -129,8 +129,9 @@ function updateAvatar (hidedefault) {
|
||||||
|
|
||||||
function showAvatarCropper () {
|
function showAvatarCropper () {
|
||||||
var $cropper = $('#cropper');
|
var $cropper = $('#cropper');
|
||||||
$cropper.prepend("<img>");
|
var $cropperImage = $('<img/>');
|
||||||
var $cropperImage = $('#cropper img');
|
$cropperImage.css('opacity', 0);
|
||||||
|
$cropper.prepend($cropperImage);
|
||||||
|
|
||||||
$cropperImage.attr('src',
|
$cropperImage.attr('src',
|
||||||
OC.generateUrl('/avatar/tmp') + '?requesttoken=' + encodeURIComponent(oc_requesttoken) + '#' + Math.floor(Math.random() * 1000));
|
OC.generateUrl('/avatar/tmp') + '?requesttoken=' + encodeURIComponent(oc_requesttoken) + '#' + Math.floor(Math.random() * 1000));
|
||||||
|
@ -147,6 +148,8 @@ function showAvatarCropper () {
|
||||||
boxHeight: 500,
|
boxHeight: 500,
|
||||||
boxWidth: 500,
|
boxWidth: 500,
|
||||||
setSelect: [0, 0, 300, 300]
|
setSelect: [0, 0, 300, 300]
|
||||||
|
}, function() {
|
||||||
|
$cropperImage.css('opacity', 1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue