From: Robin Appelman Date: Mon, 28 Nov 2016 12:44:27 +0000 (+0100) Subject: center dialog using css X-Git-Tag: v11.0RC2~111^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=26af409a6e73b02a908ec2e799252ad3bd627f4d;p=nextcloud-server.git center dialog using css Signed-off-by: Robin Appelman --- diff --git a/core/css/jquery.ocdialog.css b/core/css/jquery.ocdialog.css index 939c44f4d4e..7a7695a4e89 100644 --- a/core/css/jquery.ocdialog.css +++ b/core/css/jquery.ocdialog.css @@ -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; diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index 9d1d58bdf64..1f02a372345 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -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) });