aboutsummaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-08-30 09:00:37 +0200
committerkondou <kondou@ts.unde.re>2013-08-30 09:00:37 +0200
commitecf187393becc7dc613b4fd1322e40eb58f9f0fd (patch)
tree4e4b28955ae74fe81c4a6763ecd28ad4ac95cfe8 /settings
parentc533b8068292e2b265c3c73f3ad9e5de0e98a81d (diff)
downloadnextcloud-server-ecf187393becc7dc613b4fd1322e40eb58f9f0fd.tar.gz
nextcloud-server-ecf187393becc7dc613b4fd1322e40eb58f9f0fd.zip
Finish cropper, Get rid of TODOs, Improve \OCP\Avatar and "fix" unitests
Diffstat (limited to 'settings')
-rw-r--r--settings/js/personal.js34
1 files changed, 18 insertions, 16 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js
index abb085fac06..a62b37d8d48 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -54,29 +54,31 @@ function updateAvatar () {
}
function showAvatarCropper() {
- var $dlg = $('<div id="cropperbox" title="'+t('settings', 'Crop')+'"></div>');
+ var $dlg = $('<div class="hidden" id="cropperbox" title="'+t('settings', 'Crop')+'"><img id="cropper" src="'+OC.Router.generate('core_avatar_get_tmp')+'"></div>');
$('body').append($dlg);
- $('#cropperbox').ocdialog({
- width: '600px',
- height: '600px',
- buttons: [{
- text: t('settings', 'Crop'),
- click: sendCropData,
- defaultButton: true
- }]
- });
- var cropper = new Image();
- $(cropper).load(function() {
- $(this).attr('id', 'cropper');
- $('#cropperbox').html(this);
- $(this).Jcrop({
+
+ $cropperbox = $('#cropperbox');
+ $cropper = $('#cropper');
+
+ $cropper.on('load', function() {
+ $cropperbox.show();
+
+ $cropper.Jcrop({
onChange: saveCoords,
onSelect: saveCoords,
aspectRatio: 1,
boxHeight: 500,
boxWidth: 500
});
- }).attr('src', OC.Router.generate('core_avatar_get_tmp'));
+
+ $cropperbox.ocdialog({
+ buttons: [{
+ text: t('settings', 'Crop'),
+ click: sendCropData,
+ defaultButton: true
+ }]
+ });
+ });
}
function sendCropData() {