aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoricewind1991 <robin@icewind.nl>2014-05-14 13:34:55 +0200
committericewind1991 <robin@icewind.nl>2014-05-14 13:34:55 +0200
commit4c19acf09be85d644b8ad6f4a031d0fdfa8444e4 (patch)
treed5880a939505654f72ef0b4d947de46c73102a2d
parentc98edf18cc8f07d49d702eff39cbb48a0a2bf25d (diff)
parentc85e6d919eb333900225b8f107e03843c0f85e36 (diff)
downloadnextcloud-server-4c19acf09be85d644b8ad6f4a031d0fdfa8444e4.tar.gz
nextcloud-server-4c19acf09be85d644b8ad6f4a031d0fdfa8444e4.zip
Merge pull request #8403 from owncloud/fix-oc-dialog
fix oc dialog because the body isn't 100% x 100% in dimensions anymore
-rw-r--r--core/js/jquery.ocdialog.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js
index 02cd6ac1466..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 + (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
});
});
@@ -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) {