From 14e568b13c7d767e5c9011254392969ee10cf444 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 29 Apr 2014 15:34:48 +0200 Subject: fix oc dialog because the body isn't 100% x 100% in dimensions anymore --- core/js/jquery.ocdialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/js/jquery.ocdialog.js') 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 }); }); -- cgit v1.2.3 From 46d6cb739d1f43482a1a512b0a86782a2ae9d8d6 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 13 May 2014 11:37:29 +0200 Subject: 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(-) (limited to 'core/js/jquery.ocdialog.js') 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) { -- cgit v1.2.3 From c85e6d919eb333900225b8f107e03843c0f85e36 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 13 May 2014 12:58:02 +0200 Subject: Use jquery to get the window width --- core/js/jquery.ocdialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/js/jquery.ocdialog.js') 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 }); }); -- cgit v1.2.3