diff options
author | Robin Appelman <robin@icewind.nl> | 2016-11-28 13:44:27 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2016-11-28 13:44:27 +0100 |
commit | 26af409a6e73b02a908ec2e799252ad3bd627f4d (patch) | |
tree | 7cf5a8e841afe04b7e5e8316fe9a68d8620c3aad | |
parent | a8ce10bba33710d4b72922f6ee8856d4c25cdb32 (diff) | |
download | nextcloud-server-26af409a6e73b02a908ec2e799252ad3bd627f4d.tar.gz nextcloud-server-26af409a6e73b02a908ec2e799252ad3bd627f4d.zip |
center dialog using css
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | core/css/jquery.ocdialog.css | 3 | ||||
-rw-r--r-- | 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) }); |