From 14e568b13c7d767e5c9011254392969ee10cf444 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 29 Apr 2014 15:34:48 +0200 Subject: [PATCH 1/4] fix oc dialog because the body isn't 100% x 100% in dimensions anymore --- core/css/jquery.ocdialog.css | 7 +++---- core/js/jquery.ocdialog.js | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/css/jquery.ocdialog.css b/core/css/jquery.ocdialog.css index a1221137bc4..4dccba2d0c5 100644 --- a/core/css/jquery.ocdialog.css +++ b/core/css/jquery.ocdialog.css @@ -24,12 +24,11 @@ } .oc-dialog-buttonrow { background: white; - float: right; - position: relative; - bottom: 0; + position: absolute; + bottom: 15px; + right: 15px; display: block; margin-top: 10px; - width: 100%; } .oc-dialog-close { diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index 02cd6ac1466..b91f3ed7654 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -67,8 +67,8 @@ self.parent = self.$dialog.parent().length > 0 ? self.$dialog.parent() : $('body'); var pos = self.parent.position(); self.$dialog.css({ - left: pos.left + (self.parent.width() - self.$dialog.outerWidth())/2, - top: pos.top + (self.parent.height() - self.$dialog.outerHeight())/2 + left: pos.left + (window.innerWidth - self.$dialog.outerWidth())/2, + top: pos.top + (window.innerHeight - self.$dialog.outerHeight())/2 }); }); From 541495b1b5910935150f75d6208a25728520fd93 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 13 May 2014 11:36:31 +0200 Subject: [PATCH 2/4] Dont use absolute positioning for buttonrow --- core/css/jquery.ocdialog.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/css/jquery.ocdialog.css b/core/css/jquery.ocdialog.css index 4dccba2d0c5..a1221137bc4 100644 --- a/core/css/jquery.ocdialog.css +++ b/core/css/jquery.ocdialog.css @@ -24,11 +24,12 @@ } .oc-dialog-buttonrow { background: white; - position: absolute; - bottom: 15px; - right: 15px; + float: right; + position: relative; + bottom: 0; display: block; margin-top: 10px; + width: 100%; } .oc-dialog-close { From 46d6cb739d1f43482a1a512b0a86782a2ae9d8d6 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 13 May 2014 11:37:29 +0200 Subject: [PATCH 3/4] Don't set the dialog content height to a zero or negative value --- core/js/jquery.ocdialog.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index b91f3ed7654..66d9b12db30 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -160,10 +160,16 @@ } this.parent = this.$dialog.parent().length > 0 ? this.$dialog.parent() : $('body'); content_height = Math.min(content_height, this.parent.height()-20); - this.element.css({ - height: content_height + 'px', - width: this.$dialog.innerWidth()-20 + 'px' - }); + if (content_height> 0) { + this.element.css({ + height: content_height + 'px', + width: this.$dialog.innerWidth()-20 + 'px' + }); + } else { + this.element.css({ + width : this.$dialog.innerWidth() - 20 + 'px' + }); + } }, _createOverlay: function() { if(!this.options.modal) { From c85e6d919eb333900225b8f107e03843c0f85e36 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 13 May 2014 12:58:02 +0200 Subject: [PATCH 4/4] Use jquery to get the window width --- core/js/jquery.ocdialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index 66d9b12db30..e2433f5f980 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -67,8 +67,8 @@ 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 + left: pos.left + ($(window).innerWidth() - self.$dialog.outerWidth())/2, + top: pos.top + ($(window).innerHeight() - self.$dialog.outerHeight())/2 }); });