aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/jquery.ocdialog.js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-11-28 15:00:19 +0100
committerGitHub <noreply@github.com>2016-11-28 15:00:19 +0100
commit183bee9b67346c9669fc39983f0f98a03771fbda (patch)
tree00db74247547026bd426c16189ace4cda6574ab3 /core/js/jquery.ocdialog.js
parent6cd02a7f432032868cdec71d9a391c943b50b853 (diff)
parentb2b9abfa33f75f779e62f8f2554e2159b3bca90d (diff)
downloadnextcloud-server-183bee9b67346c9669fc39983f0f98a03771fbda.tar.gz
nextcloud-server-183bee9b67346c9669fc39983f0f98a03771fbda.zip
Merge pull request #2342 from nextcloud/filepicker-shadow
Fix filepicker styling
Diffstat (limited to 'core/js/jquery.ocdialog.js')
-rw-r--r--core/js/jquery.ocdialog.js34
1 files changed, 6 insertions, 28 deletions
diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js
index 66c7d9bd7f1..b54cce2c0ca 100644
--- a/core/js/jquery.ocdialog.js
+++ b/core/js/jquery.ocdialog.js
@@ -73,21 +73,8 @@
return false;
}
});
- $(window).resize(function() {
- 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)
- });
- // set sizes of content
- self._setSizes();
- });
this._setOptions(this.options);
- $(window).trigger('resize');
this._createOverlay();
},
_init: function() {
@@ -172,25 +159,16 @@
$.Widget.prototype._setOptions.apply(this, arguments);
},
_setSizes: function() {
- var content_height = this.$dialog.height();
+ var lessHeight = 0;
if(this.$title) {
- content_height -= this.$title.outerHeight(true);
+ lessHeight += this.$title.outerHeight(true);
}
if(this.$buttonrow) {
- content_height -= this.$buttonrow.outerHeight(true);
- }
- this.parent = this.$dialog.parent().length > 0 ? this.$dialog.parent() : $('body');
- content_height = Math.min(content_height, this.parent.height()-20);
- if (content_height> 0) {
- this.element.css({
- height: content_height + 'px',
- width: this.$dialog.innerWidth() - 30 + 'px'
- });
- } else {
- this.element.css({
- width : this.$dialog.innerWidth() - 30 + 'px'
- });
+ lessHeight += this.$buttonrow.outerHeight(true);
}
+ this.element.css({
+ 'height': 'calc(100% - ' + lessHeight + 'px)'
+ });
},
_createOverlay: function() {
if(!this.options.modal) {