]> source.dussan.org Git - nextcloud-server.git/commitdiff
float the avatar cropper over the page
authorRobin Appelman <robin@icewind.nl>
Thu, 20 Oct 2016 14:23:54 +0000 (16:23 +0200)
committerRobin Appelman <robin@icewind.nl>
Thu, 20 Oct 2016 14:23:54 +0000 (16:23 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
settings/css/settings.css
settings/js/personal.js
settings/templates/personal.php

index 39f4c28a3a5d711f344e2054a7a7c262edeea624..632162eafe264bfba69c59b25c91c1d41a23758d 100644 (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,
index 9f4a4f377b364f79a423f5e088925669bf96339f..213af93a0fe240a0fb8f64c4dbdb3f7eff98939e 100644 (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);
                });
        });
 }
index b7bb0c8bfc7de75a48e992644f9b31d5b19bb157..ea1c7ba6459b6372183bf9caf6a061ee0701eb09 100644 (file)
        </div>
 
        <div id="cropper" class="hidden">
-               <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 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; ?>