From 26af409a6e73b02a908ec2e799252ad3bd627f4d Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 28 Nov 2016 13:44:27 +0100 Subject: [PATCH] center dialog using css Signed-off-by: Robin Appelman --- core/css/jquery.ocdialog.css | 3 +++ core/js/jquery.ocdialog.js | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) 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) }); -- 2.39.5