diff options
author | kondou <kondou@ts.unde.re> | 2013-09-05 19:26:02 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-09-05 19:26:02 +0200 |
commit | 15ab79835379559c369c2d1b56ace72e02cb6d1e (patch) | |
tree | abc95af0ca412541d3d4be36e91c02409ecfc84d /settings/js/personal.js | |
parent | 6db96603a09775e38db30cb3b0fb8e0065111bb5 (diff) | |
download | nextcloud-server-15ab79835379559c369c2d1b56ace72e02cb6d1e.tar.gz nextcloud-server-15ab79835379559c369c2d1b56ace72e02cb6d1e.zip |
Fix an IE8 bug with the avatarcropper.
1. Crop an avatar
2. Crop another avatar without reloading
-> Second cropper is 28px x 30px big
Diffstat (limited to 'settings/js/personal.js')
-rw-r--r-- | settings/js/personal.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js index e19d4c83500..e6ae612d0fb 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -56,6 +56,7 @@ function updateAvatar () { function showAvatarCropper() { $cropper = $('#cropper'); + $cropper.prepend("<img>"); $cropperImage = $('#cropper img'); $cropperImage.attr('src', OC.Router.generate('core_avatar_get_tmp')+'?requesttoken='+oc_requesttoken+'#'+Math.floor(Math.random()*1000)); @@ -77,11 +78,7 @@ function showAvatarCropper() { } function sendCropData() { - $cropper = $('#cropper'); - $('#displayavatar').show(); - $cropper.hide(); - $('.jcrop-holder').remove(); - $('#cropper img').removeData('Jcrop').removeAttr('style').removeAttr('src'); + cleanCropper(); var cropperdata = $('#cropper').data(); var data = { @@ -97,6 +94,15 @@ function saveCoords(c) { $('#cropper').data(c); } +function cleanCropper() { + $cropper = $('#cropper'); + $('#displayavatar').show(); + $cropper.hide(); + $('.jcrop-holder').remove(); + $('#cropper img').removeData('Jcrop').removeAttr('style').removeAttr('src'); + $('#cropper img').remove(); +} + function avatarResponseHandler(data) { $warning = $('#avatar .warning'); $warning.hide(); @@ -228,10 +234,7 @@ $(document).ready(function(){ }); $('#abortcropperbutton').click(function(){ - $('#displayavatar').show(); - $('#cropper').hide(); - $('.jcrop-holder').remove(); - $('#cropper img').removeData('Jcrop').removeAttr('style').removeAttr('src'); + cleanCropper(); }); $('#sendcropperbutton').click(function(){ |