]> source.dussan.org Git - nextcloud-server.git/commitdiff
center dialog using css
authorRobin Appelman <robin@icewind.nl>
Mon, 28 Nov 2016 12:44:27 +0000 (13:44 +0100)
committerRobin Appelman <robin@icewind.nl>
Mon, 28 Nov 2016 12:44:27 +0000 (13:44 +0100)
Signed-off-by: Robin Appelman <robin@icewind.nl>
core/css/jquery.ocdialog.css
core/js/jquery.ocdialog.js

index 939c44f4d4e78051bbb8a8c396815d306dc986b0..7a7695a4e8924f780bda61e34aa0df9799bf13aa 100644 (file)
@@ -9,6 +9,9 @@
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        min-width: 200px;
+       top: 50%;
+       left: 50%;
+       transform: translate(-50%, -50%);
 }
 .oc-dialog-title {
        background: #fff;
index 9d1d58bdf64c5e84a91acfeac90ec30402e54178..1f02a372345be7e1aceaebae70338b5b13912e77 100644 (file)
@@ -77,8 +77,6 @@
                                self.parent = self.$dialog.parent().length > 0 ? self.$dialog.parent() : $('body');
                                var pos = self.parent.position();
                                self.$dialog.css({
-                                       left: pos.left + ($(window).innerWidth() - self.$dialog.outerWidth())/2,
-                                       top: pos.top + ($(window).innerHeight() - self.$dialog.outerHeight())/2,
                                        width: Math.min(self.options.width, $(window).innerWidth() - 20 ),
                                        height: Math.min(self.options.height, $(window).innerHeight() - 20)
                                });