float the avatar cropper over the page

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2016-10-20 16:23:54 +02:00
parent 5a44b70efc
commit 9983b5533a
No known key found for this signature in database
GPG Key ID: 425003AC385454C5
3 changed files with 38 additions and 8 deletions

View File

@ -30,9 +30,39 @@ input#openid, input#webdav { width:20em; }
}
#avatar #cropper {
float: left;
background-color: #fff;
z-index: 500;
position: relative;
/* float cropper above settings page to prevent unexpected flowing from dynamically sized element */
position: fixed;
background-color: rgba(0, 0, 0, .2);
/*opacity: .20;*/
box-sizing: border-box;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding-top: 45px;
text-align: center;
}
#avatar #cropper .inner-container {
display: inline-block;
margin-top: 160px;
margin-left: 30px;
background: #fff;
color: #333;
border-radius: 3px;
box-shadow: 0 0 7px #888;
padding: 15px;
text-align: left;
}
#avatar #cropper .inner-container .jcrop-holder {
box-shadow: 0 0 7px #888;
}
#avatar #cropper .inner-container .button {
margin-top: 15px;
}
#avatar #cropper .inner-container .primary {
float: right;
}
#displaynameform,

View File

@ -130,8 +130,8 @@ function updateAvatar (hidedefault) {
function showAvatarCropper () {
var $cropper = $('#cropper');
var $cropperImage = $('<img/>');
$cropperImage.css('opacity', 0);
$cropper.prepend($cropperImage);
$cropperImage.css('opacity', 0); // prevent showing the unresized image
$cropper.children('.inner-container').prepend($cropperImage);
$cropperImage.attr('src',
OC.generateUrl('/avatar/tmp') + '?requesttoken=' + encodeURIComponent(oc_requesttoken) + '#' + Math.floor(Math.random() * 1000));
@ -148,8 +148,6 @@ function showAvatarCropper () {
boxHeight: 500,
boxWidth: 500,
setSelect: [0, 0, 300, 300]
}, function() {
$cropperImage.css('opacity', 1);
});
});
}

View File

@ -50,9 +50,11 @@
</div>
<div id="cropper" class="hidden">
<div class="inner-container">
<div class="inlineblock button" id="abortcropperbutton"><?php p($l->t('Cancel')); ?></div>
<div class="inlineblock button primary" id="sendcropperbutton"><?php p($l->t('Choose as profile picture')); ?></div>
</div>
</div>
</form>
<?php endif; ?>